Skip to content

Commit cfcefc0

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Remove unused variables in faiss/utils/sorting.cpp
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
1 parent f884ba2 commit cfcefc0

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

faiss/utils/sorting.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ void bucket_sort_inplace_parallel(
544544

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

557-
tot_written += n_to_write;
558-
// assert(tot_written <= nval);
559-
560556
#pragma omp master
561557
{
562558
if (verbose >= 1) {

0 commit comments

Comments
 (0)