Skip to content

Commit

Permalink
Remove unused variables in faiss/IndexBinaryIVF.cpp
Browse files Browse the repository at this point in the history
Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53779472

fbshipit-source-id: 0efad740e4741950ee023ac77c4ca8c2f0d03c61
  • Loading branch information
r-barnes authored and facebook-github-bot committed Feb 15, 2024
1 parent 1b0d274 commit 1338e0d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions faiss/IndexBinaryIVF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ struct IVFBinaryScannerL2 : BinaryInvertedListScanner {
const idx_t* __restrict ids,
int radius,
RangeQueryResult& result) const override {
size_t nup = 0;
for (size_t j = 0; j < n; j++) {
uint32_t dis = hc.hamming(codes);
if (dis < radius) {
Expand Down Expand Up @@ -651,7 +650,6 @@ void search_knn_hamming_per_invlist(
idx_t max_codes = params ? params->max_codes : ivf->max_codes;
FAISS_THROW_IF_NOT(max_codes == 0);
FAISS_THROW_IF_NOT(!store_pairs);
MetricType metric_type = ivf->metric_type;

// reorder buckets
std::vector<int64_t> lims(n + 1);
Expand Down

0 comments on commit 1338e0d

Please sign in to comment.