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


##########
lucene/core/src/java/org/apache/lucene/search/MaxScoreBulkScorer.java:
##########
@@ -381,9 +423,20 @@ private void scoreNonEssentialClauses(
       scorer.doc = scorer.iterator.docID();
     }
 
-    for (int i = 0; i < buffer.size; ++i) {
-      scorable.score = (float) buffer.scores[i];
-      collector.collect(buffer.docs[i]);
+    // The collector already filters hits whose score is less than the min 
competitive score, but
+    // doing it here is a bit more efficient.
+    int[] docs = buffer.docs;
+    docAndScoreBuffer.growNoCopy(buffer.size);
+    float[] scores = docAndScoreBuffer.features;
+    int size = buffer.size;

Review Comment:
   I don't think it does. In case you missed it, it's using the `int[] docs` 
from `docAndScore*Acc*Buffer` and the `float[] features` from 
`docAndScoreBuffer`. So I found extracting variables clearer than picking 
arrays from different buffer objects directly.



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