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


##########
lucene/suggest/src/java/org/apache/lucene/search/suggest/document/TopSuggestDocsCollector.java:
##########
@@ -136,15 +143,7 @@ public TopSuggestDocs get() throws IOException {
     SuggestScoreDoc[] suggestScoreDocs;
 
     if (seenSurfaceForms != null) {
-      // NOTE: this also clears the priorityQueue:
-      for (SuggestScoreDoc hit : priorityQueue.getResults()) {
-        pendingResults.add(hit);
-      }
-
-      // Deduplicate all hits: we already dedup'd efficiently within each 
segment by
-      // truncating the FST top paths search, but across segments there may 
still be dups:
-      seenSurfaceForms.clear();

Review Comment:
   +1 I liked moving the `clear` last better



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