Skip to content

Commit

Permalink
use follt::collect to wait and get a list of futures
Browse files Browse the repository at this point in the history
Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
  • Loading branch information
zhengbuqian committed Jan 19, 2024
1 parent 31236d8 commit b569ba7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/common/comp/brute_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,7 @@ BruteForce::SearchSparseWithBuf(const DataSetPtr base_dataset, const DataSetPtr
}
}));
}
for (auto& fut : futs) {
fut.get();
}
follt::collect(futs.begin(), futs.end()).get();
return Status::success;
}

Expand Down
4 changes: 1 addition & 3 deletions src/index/sparse/sparse_index_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ class SparseInvertedIndexNode : public IndexNode {
bitset);
}));
}
for (auto& fut : futs) {
fut.get();
}
follt::collect(futs.begin(), futs.end()).get();
return GenResultDataSet(nq, k, p_id.release(), p_dist.release());
}

Expand Down

0 comments on commit b569ba7

Please sign in to comment.