Skip to content

Commit

Permalink
Remove unused variables in faiss/utils/sorting.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: bunnypak, dmm-fb

Differential Revision: D53011673

fbshipit-source-id: 011204944fdc48627a34e1358833fc525dcc2c28
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jan 24, 2024
1 parent e8494f6 commit 99c0e2b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion faiss/utils/sorting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,6 @@ void hashtable_int64_to_int64_lookup(
std::vector<int64_t> hk(n), bucket_no(n);
int64_t mask = capacity - 1;
int log2_nbucket = log2_capacity_to_log2_nbucket(log2_capacity);
size_t nbucket = (size_t)1 << log2_nbucket;

#pragma omp parallel for
for (int64_t i = 0; i < n; i++) {
Expand Down

0 comments on commit 99c0e2b

Please sign in to comment.