Skip to content

Commit

Permalink
Stop division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinMendelGleason committed Apr 26, 2024
1 parent d05023f commit 3dfde46
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parallel-hnsw/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ impl<C> Layer<C> {
}

pub fn routing_nodes(&self, nodeid: NodeId, sp: SearchParameters) -> Vec<NodeId> {
if sp.grid_network_dimension == 0 {
return Vec::new();
}
let increment = self.node_count() / sp.grid_network_dimension;
let mut routing_nodes = Vec::with_capacity(sp.grid_network_dimension);
for i in 1..sp.grid_network_dimension + 1 {
Expand Down

0 comments on commit 3dfde46

Please sign in to comment.