Skip to content

Commit

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

Differential Revision: D52981034

fbshipit-source-id: 0315bb594a2dfaa059132b5f4e41855a4e15034b
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jan 23, 2024
1 parent e55a0ac commit b274cb4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions faiss/IndexIVFFastScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ void IndexIVFFastScan::search_implem_10(

bool single_LUT = !lookup_table_is_3d();

size_t ndis = 0, nlist_visited = 0;
size_t ndis = 0;
int qmap1[1];

handler.q_map = qmap1;
Expand Down Expand Up @@ -906,7 +906,6 @@ void IndexIVFFastScan::search_implem_10(
handler,
scaler);

nlist_visited++;
ndis++;
}
}
Expand Down

0 comments on commit b274cb4

Please sign in to comment.