Move reset of insertion into add_neighbor_heuristic()

This commit is contained in:
Dirkjan Ochtman 2021-01-21 10:12:05 +01:00
parent a0b90dfd66
commit 1d5cd4e6ec
1 changed files with 1 additions and 1 deletions

View File

@ -403,7 +403,6 @@ fn insert<P: Point>(
// `candidate` here is the new node's neighbor
let &Candidate { distance, pid } = candidate;
if let Some(heuristic) = heuristic {
insertion.reset();
let found = insertion.add_neighbor_heuristic(
new,
layer.as_slice().nearest_iter(pid),
@ -524,6 +523,7 @@ impl Search {
points: &[P],
params: Heuristic,
) -> &[Candidate] {
self.reset();
self.push(new, point, points);
for pid in current {
self.push(pid, point, points);