jpountz commented on code in PR #12836:
URL: https://github.com/apache/lucene/pull/12836#discussion_r1403533598


##########
lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:
##########
@@ -5237,13 +5234,10 @@ public int get(int docID) {
         for (int i = 0; i < docMaps.length; ++i) {
           MergeState.DocMap reorderDocMap = reorderDocMaps[i];
           docMaps[i] =
-              new MergeState.DocMap() {
-                @Override
-                public int get(int docID) {
-                  int reorderedDocId = reorderDocMap.get(docID);
-                  int compactedDocId = compactionDocMap.get(reorderedDocId);
-                  return compactedDocId;
-                }
+              docID -> {
+                int reorderedDocId = reorderDocMap.get(docID);
+                int compactedDocId = compactionDocMap.get(reorderedDocId);
+                return compactedDocId;

Review Comment:
   Seeing the above makes me want to write something along the lines of 
`(reorderDocMap::get).andThen(compactionDocMap::get)`. (Just food for thoughts, 
it might not actually be practical)



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