NeighborQueue.reset() now clears incomplete flag

This commit is contained in:
Michael Sokolov 2023-05-18 10:12:47 -04:00
parent 3e4ca4042c
commit 6b51cce0b8
2 changed files with 3 additions and 0 deletions

View File

@ -156,6 +156,7 @@ public class NeighborQueue {
public void clear() {
heap.clear();
visitedCount = 0;
incomplete = false;
}
public int visitedCount() {

View File

@ -72,10 +72,12 @@ public class TestNeighborQueue extends LuceneTestCase {
nn.add(1, 1.1f);
nn.add(2, -2.2f);
nn.setVisitedCount(42);
nn.markIncomplete();
nn.clear();
assertEquals(0, nn.size());
assertEquals(0, nn.visitedCount());
assertFalse(nn.incomplete());
}
public void testMaxSizeQueue() {