Make Search::reset() more robust to future changes
This commit is contained in:
parent
098a4e4ef6
commit
1871b61b08
16
src/lib.rs
16
src/lib.rs
|
@ -217,10 +217,18 @@ pub struct Search {
|
||||||
impl Search {
|
impl Search {
|
||||||
/// Resets the state to be ready for a new search
|
/// Resets the state to be ready for a new search
|
||||||
fn reset(&mut self) {
|
fn reset(&mut self) {
|
||||||
self.visited.clear();
|
let Search {
|
||||||
self.candidates.clear();
|
visited,
|
||||||
self.nearest.clear();
|
candidates,
|
||||||
self.furthest = OrderedFloat::from(f32::INFINITY);
|
nearest,
|
||||||
|
num: _,
|
||||||
|
furthest,
|
||||||
|
} = self;
|
||||||
|
|
||||||
|
visited.clear();
|
||||||
|
candidates.clear();
|
||||||
|
nearest.clear();
|
||||||
|
*furthest = OrderedFloat::from(f32::INFINITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Track node `pid` as a potential new neighbor for the given `point`
|
/// Track node `pid` as a potential new neighbor for the given `point`
|
||||||
|
|
Loading…
Reference in New Issue