From d42bf8adc97806866a59826f1549266121e14ca1 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 17 Dec 2020 13:04:16 +0100 Subject: [PATCH] Rename num argument to Layer::search() to links --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 68e12d1..fe9b9fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -417,12 +417,12 @@ trait Layer { /// element; `search.candidates` contains the enter points `ep`. `points` contains all the /// points, which is required to calculate distances between two points. /// - /// The `num` argument represents the number of links from each candidate to consider. This + /// The `links` argument represents the number of links from each candidate to consider. This /// function may be called for a higher layer (with M links per node) or the zero layer (with /// M * 2 links per node), but for performance reasons we often call this function on the data /// representation matching the zero layer even when we're referring to a higher layer. In that - /// case, we use `num` to constrain the number of per-candidate links we consider for search. - fn search(&self, point: &P, search: &mut Search, points: &[P], num: usize) { + /// case, we use `links` to constrain the number of per-candidate links we consider for search. + fn search(&self, point: &P, search: &mut Search, points: &[P], links: usize) { while let Some(candidate) = search.candidates.pop() { if let Some(found) = search.nearest.last() { if candidate.distance > found.distance { @@ -430,7 +430,7 @@ trait Layer { } } - for pid in self.nearest_iter(candidate.pid).take(num) { + for pid in self.nearest_iter(candidate.pid).take(links) { search.push(pid, point, points); } }