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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]