Skip to content

Commit

Permalink
Clean up graph logic
Browse files Browse the repository at this point in the history
  • Loading branch information
syvb committed Nov 1, 2024
1 parent 8596d56 commit 4a07b33
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pgvectorscale/src/access_method/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl<'a> Graph<'a> {
}
}
//remove myself
if !hash.insert(neighbors_of) {
if hash.contains(&neighbors_of) {
//prevent self-loops
let index = candidates
.iter()
Expand Down Expand Up @@ -531,18 +531,14 @@ impl<'a> Graph<'a> {
);

//update back pointers
let mut cnt = 0;
for neighbor in neighbor_list {
let needed_prune = self.update_back_pointer(
self.update_back_pointer(
neighbor.get_index_pointer_to_neighbor(),
index_pointer,
neighbor.get_distance(),
storage,
&mut stats.prune_neighbor_stats,
);
if needed_prune {
cnt = cnt + 1;
}
}
}

Expand Down

0 comments on commit 4a07b33

Please sign in to comment.