costin commented on code in PR #16160:
URL: https://github.com/apache/lucene/pull/16160#discussion_r3416805523


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesProducer.java:
##########
@@ -480,6 +480,59 @@ static void rangeIntoBitSet(
         values, fromDoc, toDoc, minValue, maxValue, bitSet, offset);
   }
 
+  private static void rangeGcdDeltaIntoBitSet(
+      LongValues values,
+      int fromDoc,
+      int toDoc,
+      long minValue,
+      long maxValue,
+      long mul,
+      long delta,
+      FixedBitSet bitSet,
+      int offset) {
+    long encodedMin;
+    long encodedMax;
+    try {
+      encodedMin = Math.subtractExact(minValue, delta);
+      encodedMax = Math.subtractExact(maxValue, delta);
+      if (mul != 1) {
+        encodedMin = ceilDiv(encodedMin, mul);

Review Comment:
   With mul > 0 it's overflow-safe, so the Math.addExact in the positive branch 
was redundant. Reads symmetric to Math.floorDiv now



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to