Skip to content

Commit

Permalink
fix some issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanhaoji2 committed Dec 30, 2024
1 parent 1216321 commit dd301d8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/pq_flash_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ void PQFlashIndex<T, LabelT>::cache_bfs_levels(uint64_t num_nodes_to_cache, std:
uint64_t lvl = 1;
uint64_t prev_node_set_size = 0;
uint64_t current_count = 0;
bool finish_flag = false;
while (cur_level->size() != 0)
{
// swap prev_level and cur_level
Expand Down Expand Up @@ -479,16 +478,12 @@ void PQFlashIndex<T, LabelT>::cache_bfs_levels(uint64_t num_nodes_to_cache, std:
uint32_t *nbrs = nbr_buffers[i].second;

// explore next level
for (uint32_t j = 0; j < nnbrs && !finish_flag; j++)
for (uint32_t j = 0; j < nnbrs && (cur_level->size() + node_set.size() < num_nodes_to_cache); j++)
{
if (node_set.find(nbrs[j]) == node_set.end())
{
cur_level->insert(nbrs[j]);
}
if (cur_level->size() + node_set.size() >= num_nodes_to_cache)
{
finish_flag = true;
}
}
}
}
Expand Down

0 comments on commit dd301d8

Please sign in to comment.