uschindler commented on code in PR #15116:
URL: https://github.com/apache/lucene/pull/15116#discussion_r2296708813


##########
lucene/core/src/java/org/apache/lucene/util/GroupVIntUtil.java:
##########
@@ -64,6 +66,42 @@ public static void readGroupVInt(DataInput in, int[] dst, 
int offset) throws IOE
     final int n3Minus1 = (flag >> 2) & 0x03;
     final int n4Minus1 = flag & 0x03;
 
+    // if our DataInput implements RandomAccessInput for absolute access and 
IndexInput for seeking,
+    // we use a branch-less implementation:
+    if (in instanceof RandomAccessInput rin && in instanceof IndexInput iin) {
+      long pos = iin.getFilePointer();
+      if (iin.length() - pos >= MAX_LENGTH_PER_GROUP) {

Review Comment:
   Actually this is not a real bug, it just causes theta it fallbacks to the 
slower version for the end of the file.
   
   I think correct would be `>` instead of `>=`, correct?



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