jainankitk commented on code in PR #14626:
URL: https://github.com/apache/lucene/pull/14626#discussion_r2105308858


##########
lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java:
##########
@@ -154,16 +154,18 @@ private Relation relate(byte[] minPackedValue, byte[] 
maxPackedValue) {
             return Relation.CELL_OUTSIDE_QUERY;
           }
 
-          crosses |=
-              comparator.compare(minPackedValue, offset, lowerPoint, offset) < 0
-                  || comparator.compare(maxPackedValue, offset, upperPoint, 
offset) > 0;
+          if (crosses == false) {

Review Comment:
   Unfortunately, the current command is equivalent to:
   
   ```
   crosses = crosses | (comparator.compare(minPackedValue, offset, lowerPoint, 
offset) < 0
                     || comparator.compare(maxPackedValue, offset, upperPoint, 
offset) > 0);
   ```
   
   In Java, the bitwise OR operator | can be applied to boolean operands. When 
used with booleans, it performs a logical OR operation, _but it evaluates both 
operands regardless of the left operand's value_. This is different from the 
logical OR operator ||, which short-circuits and doesn't evaluate the right 
operand if the left operand is true.



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