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 {
|
||||
/// Resets the state to be ready for a new search
|
||||
fn reset(&mut self) {
|
||||
self.visited.clear();
|
||||
self.candidates.clear();
|
||||
self.nearest.clear();
|
||||
self.furthest = OrderedFloat::from(f32::INFINITY);
|
||||
let Search {
|
||||
visited,
|
||||
candidates,
|
||||
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`
|
||||
|
|
Loading…
Reference in New Issue