Skip to content

Commit

Permalink
Remove empty iterator for neighborqueue
Browse files Browse the repository at this point in the history
Signed-off-by: John Mazanec <jmazane@amazon.com>
  • Loading branch information
jmazanec15 committed Jan 31, 2023
1 parent 56f114f commit d40f225
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static NeighborQueue search(

int initialEp = graph.entryNode();
if (initialEp == -1) {
return NeighborQueue.EMPTY_MAX_HEAP_NEIGHBOR_QUEUE;
return new NeighborQueue(1, true);
}
int[] eps = new int[] {initialEp};
int numVisited = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ long apply(long v) {
// Whether the search stopped early because it reached the visited nodes limit
private boolean incomplete;

public static final NeighborQueue EMPTY_MAX_HEAP_NEIGHBOR_QUEUE = new NeighborQueue(1, true);

public NeighborQueue(int initialSize, boolean maxHeap) {
this.heap = new LongHeap(initialSize);
this.order = maxHeap ? Order.MAX_HEAP : Order.MIN_HEAP;
Expand Down

0 comments on commit d40f225

Please sign in to comment.