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


##########
lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -303,6 +304,30 @@ public byte readByte(long pos) throws IOException {
     }
   }
 
+  @Override
+  public void readGroupVInts(long[] dst, int limit) throws IOException {
+    int i;
+    try {
+      for (i = 0; i <= limit - 4; i += 4) {
+        final MemorySegment curSegment = this.curSegment;

Review Comment:
   I would not do this, because it would make a captured lambda. Just remove 
the local variable. Adrien's argument does not apply here, as this would also 
affect other methods in MemorySegmentIndexInput. In fact the curSegment field 
can't change in the actual thread, it is stable.
   
   This would also explain why NIOFSDir has problems?



##########
lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java:
##########
@@ -303,6 +304,30 @@ public byte readByte(long pos) throws IOException {
     }
   }
 
+  @Override
+  public void readGroupVInts(long[] dst, int limit) throws IOException {
+    int i;
+    try {
+      for (i = 0; i <= limit - 4; i += 4) {

Review Comment:
   why can't we move the whole loop into the utility class? As said before it 
is unlikely that we hit the boundary.



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