From 1d5cd4e6ecfccac0f676184a57d8a247d60bc844 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 21 Jan 2021 10:12:05 +0100 Subject: [PATCH] Move reset of insertion into add_neighbor_heuristic() --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1bf32ee..dbf1fc2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -403,7 +403,6 @@ fn insert( // `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);