From f61659cca5a7dd0ed744f94ffe96fa6e04941db3 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 7 Jan 2021 16:00:56 +0100 Subject: [PATCH] Search in appropriate layer during construction --- src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9bcd616..005ecd8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -132,10 +132,15 @@ where search.push(PointId(0), point, &points); for cur in top.descend() { search.ef = if cur <= layer { ef_construction } else { 1 }; - zero.search(point, search, &points, num); match cur > layer { - true => search.cull(), - false => break, + true => { + layers[cur.0 - 1].search(point, search, &points, num); + search.cull(); + } + false => { + zero.search(point, search, &points, num); + break; + } } } });