epotyom commented on code in PR #13559:
URL: https://github.com/apache/lucene/pull/13559#discussion_r1697608653


##########
lucene/join/src/java/org/apache/lucene/search/join/BlockJoinSelector.java:
##########
@@ -64,14 +64,19 @@ public boolean get(int docID) {
           return false;
         }
 
-        final int firstChild = parents.prevSetBit(docID - 1) + 1;
-        for (int child = children.nextSetBit(firstChild);
-            child < docID;
-            child = children.nextSetBit(child + 1)) {
-          if (docsWithValue.get(child)) {
-            return true;
+        final int lastPotentialChild = docID - 1;
+
+        final int firstPotentialChild = parents.prevSetBit(lastPotentialChild) 
+ 1;
+        if (firstPotentialChild < docID) {
+          for (int child = children.firstSetBitInRange(firstPotentialChild, 
lastPotentialChild);
+              child != DocIdSetIterator.NO_MORE_DOCS;
+              child = children.firstSetBitInRange(child + 1, 
lastPotentialChild)) {
+            if (docsWithValue.get(child)) {
+              return true;
+            }

Review Comment:
   I'll apply the suggestion, thanks!



-- 
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