iverase commented on code in PR #14391:
URL: https://github.com/apache/lucene/pull/14391#discussion_r2009830096


##########
lucene/core/src/java/org/apache/lucene/index/PointValues.java:
##########
@@ -351,35 +351,32 @@ public final void intersect(IntersectVisitor visitor) 
throws IOException {
     assert pointTree.moveToParent() == false;
   }
 
-  private void intersect(IntersectVisitor visitor, PointTree pointTree) throws 
IOException {
-    Relation r = visitor.compare(pointTree.getMinPackedValue(), 
pointTree.getMaxPackedValue());
-    switch (r) {
-      case CELL_OUTSIDE_QUERY:
-        // This cell is fully outside the query shape: stop recursing
-        break;
-      case CELL_INSIDE_QUERY:
+  private static void intersect(IntersectVisitor visitor, PointTree pointTree) 
throws IOException {
+    int depth = 0;

Review Comment:
   I don' think we need this variable, what do you think about this: 
   ```
     public final void intersect(IntersectVisitor visitor) throws IOException {
       final PointTree pointTree = getPointTree();
       while (true) {
         Relation compare =
                 visitor.compare(pointTree.getMinPackedValue(), 
pointTree.getMaxPackedValue());
         if (compare == Relation.CELL_INSIDE_QUERY) {
           // This cell is fully inside the query shape: recursively add all 
points in this cell
           // without filtering
           pointTree.visitDocIDs(visitor);
         } else if (compare == Relation.CELL_CROSSES_QUERY) {
           // The cell crosses the shape boundary, or the cell fully contains 
the query, so we fall
           // through and do full filtering:
           if (pointTree.moveToChild()) {
             continue;
           }
           // TODO: we can assert that the first value here in fact matches 
what the pointTree
           // claimed?
           // Leaf node; scan and filter all points in this block:
           pointTree.visitDocValues(visitor);
         }
         while (pointTree.moveToSibling() == false) {
           if (pointTree.moveToParent() == false) {
             // we are at the root, finish.
             return;
           }
         }
       }
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to