Skip to content

Commit

Permalink
Remove unused variables in faiss/IndexIVFPQ.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: D53779571

fbshipit-source-id: 008ce210aee7eb8668587cb40154563ada0172db
  • Loading branch information
r-barnes authored and facebook-github-bot committed Feb 15, 2024
1 parent 1338e0d commit a87b432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion faiss/IndexIVFPQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ struct IVFPQScannerT : QueryTables {
const uint8_t* codes,
SearchResultType& res) const {
int ht = ivfpq.polysemous_ht;
size_t n_hamming_pass = 0, nup = 0;
size_t n_hamming_pass = 0;

int code_size = pq.code_size;

Expand Down

0 comments on commit a87b432

Please sign in to comment.