Move reset of insertion into add_neighbor_heuristic()
This commit is contained in:
parent
a0b90dfd66
commit
1d5cd4e6ec
|
@ -403,7 +403,6 @@ fn insert<P: Point>(
|
||||||
// `candidate` here is the new node's neighbor
|
// `candidate` here is the new node's neighbor
|
||||||
let &Candidate { distance, pid } = candidate;
|
let &Candidate { distance, pid } = candidate;
|
||||||
if let Some(heuristic) = heuristic {
|
if let Some(heuristic) = heuristic {
|
||||||
insertion.reset();
|
|
||||||
let found = insertion.add_neighbor_heuristic(
|
let found = insertion.add_neighbor_heuristic(
|
||||||
new,
|
new,
|
||||||
layer.as_slice().nearest_iter(pid),
|
layer.as_slice().nearest_iter(pid),
|
||||||
|
@ -524,6 +523,7 @@ impl Search {
|
||||||
points: &[P],
|
points: &[P],
|
||||||
params: Heuristic,
|
params: Heuristic,
|
||||||
) -> &[Candidate] {
|
) -> &[Candidate] {
|
||||||
|
self.reset();
|
||||||
self.push(new, point, points);
|
self.push(new, point, points);
|
||||||
for pid in current {
|
for pid in current {
|
||||||
self.push(pid, point, points);
|
self.push(pid, point, points);
|
||||||
|
|
Loading…
Reference in New Issue