Skip to content

Commit d930f6e

Browse files
simpler
1 parent 10ca1cc commit d930f6e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lucene/core/src/java/org/apache/lucene/index/PointValues.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,7 @@ public final void intersect(IntersectVisitor visitor) throws IOException {
352352
}
353353

354354
private static void intersect(IntersectVisitor visitor, PointTree pointTree) throws IOException {
355-
int depth = 0;
356-
do {
355+
while (true) {
357356
Relation compare =
358357
visitor.compare(pointTree.getMinPackedValue(), pointTree.getMaxPackedValue());
359358
if (compare == Relation.CELL_INSIDE_QUERY) {
@@ -364,19 +363,19 @@ private static void intersect(IntersectVisitor visitor, PointTree pointTree) thr
364363
// The cell crosses the shape boundary, or the cell fully contains the query, so we fall
365364
// through and do full filtering:
366365
if (pointTree.moveToChild()) {
367-
depth++;
368366
continue;
369367
}
370368
// TODO: we can assert that the first value here in fact matches what the pointTree
371369
// claimed?
372370
// Leaf node; scan and filter all points in this block:
373371
pointTree.visitDocValues(visitor);
374372
}
375-
while (depth > 0 && pointTree.moveToSibling() == false) {
376-
pointTree.moveToParent();
377-
depth--;
373+
while (pointTree.moveToSibling() == false) {
374+
if (pointTree.moveToParent() == false) {
375+
return;
376+
}
378377
}
379-
} while (depth > 0);
378+
}
380379
}
381380

382381
/**

0 commit comments

Comments
 (0)