Skip to content

Commit 757aebf

Browse files
Update code based on the comments
Signed-off-by: Prudhvi Godithi <[email protected]>
1 parent 6b56848 commit 757aebf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQuery.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,12 @@ public void intersectRight(PointValues.IntersectVisitor visitor, PointValues.Poi
298298
case CELL_INSIDE_QUERY:
299299
case CELL_CROSSES_QUERY:
300300
if (pointTree.moveToChild() && docCount[0] < size) {
301-
while (pointTree.moveToSibling()) {
302-
}
303-
301+
// BKD is binary today, so one moveToSibling() is enough to land on the right child.
302+
// If PointTree ever becomes n-ary, update the traversal below to visit all siblings or re-enable a full loop.
303+
pointTree.moveToSibling();
304+
assert pointTree.moveToSibling() == false;
304305
intersectRight(visitor, pointTree, docCount);
305-
306306
pointTree.moveToParent();
307-
308307
if (docCount[0] < size) {
309308
pointTree.moveToChild();
310309
intersectRight(visitor, pointTree, docCount);

0 commit comments

Comments
 (0)