Skip to content

Commit

Permalink
Improve naming due to codemod (#4065)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #4065

improve neighbors_2 naming from codemod

Reviewed By: junjieqi

Differential Revision: D66823395

fbshipit-source-id: 90af06e7f6d917581a25311944689f82f12c93e1
  • Loading branch information
mengdilin authored and facebook-github-bot committed Dec 5, 2024
1 parent 0868ffc commit 9bb6948
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions faiss/impl/HNSW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,17 +493,17 @@ void HNSW::add_links_starting_from(

::faiss::shrink_neighbor_list(ptdis, link_targets, M, keep_max_size_level0);

std::vector<storage_idx_t> neighbors_2;
neighbors_2.reserve(link_targets.size());
std::vector<storage_idx_t> neighbors_to_add;
neighbors_to_add.reserve(link_targets.size());
while (!link_targets.empty()) {
storage_idx_t other_id = link_targets.top().id;
add_link(*this, ptdis, pt_id, other_id, level, keep_max_size_level0);
neighbors_2.push_back(other_id);
neighbors_to_add.push_back(other_id);
link_targets.pop();
}

omp_unset_lock(&locks[pt_id]);
for (storage_idx_t other_id : neighbors_2) {
for (storage_idx_t other_id : neighbors_to_add) {
omp_set_lock(&locks[other_id]);
add_link(*this, ptdis, other_id, pt_id, level, keep_max_size_level0);
omp_unset_lock(&locks[other_id]);
Expand Down

0 comments on commit 9bb6948

Please sign in to comment.