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: meyering

Differential Revision: D52734585

fbshipit-source-id: be5da3411d2965f6cd2516376598576049c03f09
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jan 14, 2024
1 parent f884ba2 commit cfcefc0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions faiss/utils/sorting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ void bucket_sort_inplace_parallel(

// in this loop, we write elements collected in the previous round
// and collect the elements that are overwritten for the next round
size_t tot_written = 0;
int round = 0;
for (;;) {
#pragma omp barrier
Expand All @@ -554,9 +553,6 @@ void bucket_sort_inplace_parallel(
n_to_write += to_write_2.lims.back();
}

tot_written += n_to_write;
// assert(tot_written <= nval);

#pragma omp master
{
if (verbose >= 1) {
Expand Down

0 comments on commit cfcefc0

Please sign in to comment.