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() { public void clear() {
heap.clear(); heap.clear();
visitedCount = 0; visitedCount = 0;
incomplete = false;
} }
public int visitedCount() { public int visitedCount() {

View File

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