We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b50cf1 commit 102b74aCopy full SHA for 102b74a
server/src/main/java/org/elasticsearch/index/codec/vectors/cluster/NeighborQueue.java
@@ -142,9 +142,16 @@ public long popRaw() {
142
return heap.pop();
143
}
144
145
- /** Removes the top element, returns it and adds the new encoded element */
+ /**
146
+ * if the new element is the new top then return its node id. Otherwise,
147
+ * removes the current top element, returns its node id and adds the new element
148
+ * to the queue.
149
+ * */
150
public int popAndAddRaw(long raw) {
151
long top = heap.top();
152
+ if (raw < top) {
153
+ return decodeNodeId(raw);
154
+ }
155
heap.updateTop(raw);
156
return decodeNodeId(top);
157
0 commit comments