You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/05/17 13:26:57 UTC

[GitHub] [lucene] dweiss commented on a change in pull request #141: LUCENE-9960: Avoid unnecessary top element replacement for equal elements in PQ

dweiss commented on a change in pull request #141:
URL: https://github.com/apache/lucene/pull/141#discussion_r633528657



##########
File path: lucene/core/src/java/org/apache/lucene/util/PriorityQueue.java
##########
@@ -138,7 +141,7 @@ public T insertWithOverflow(T element) {
     if (size < maxSize) {
       add(element);
       return null;
-    } else if (size > 0 && !lessThan(element, heap[1])) {

Review comment:
       This is the core of the change that makes pq object selection "stable".




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org