Skip to content

Commit

Permalink
only memmove the queue items below "lo" index, if "lo" index is less …
Browse files Browse the repository at this point in the history
…than size.
  • Loading branch information
SMovaghati committed Dec 11, 2023
1 parent 5744060 commit 71bd6c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/neighbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class NeighborPriorityQueue
}
}

if (lo < _capacity)
if (lo < _size)
{
std::memmove(&_data[lo + 1], &_data[lo], (_size - lo) * sizeof(Neighbor));
}
Expand Down

0 comments on commit 71bd6c3

Please sign in to comment.