Skip to content

Commit b8e4489

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Remove unused variables in faiss/IndexIVFFastScan.cpp (#3439)
Summary: Pull Request resolved: #3439 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, junjieqi Differential Revision: D57344013 fbshipit-source-id: adf410139d2e6ca69a26ccdbff8511c9b7620489
1 parent 558a7c3 commit b8e4489

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

faiss/IndexIVFFastScan.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -914,10 +914,6 @@ void IndexIVFFastScan::search_implem_10(
914914
size_t* nlist_out,
915915
const NormTableScaler* scaler,
916916
const IVFSearchParameters* params) const {
917-
const size_t max_codes = params ? params->max_codes : this->max_codes;
918-
const SearchParameters* quantizer_params =
919-
params ? params->quantizer_params : nullptr;
920-
921917
size_t dim12 = ksub * M2;
922918
AlignedTable<uint8_t> dis_tables;
923919
AlignedTable<uint16_t> biases;

tutorial/cpp/6-HNSW.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ int main() {
3737
xq[d * i] += i / 1000.;
3838
}
3939

40-
int nlist = 100;
4140
int k = 4;
4241

4342
faiss::IndexHNSWFlat index(d, 32);

0 commit comments

Comments
 (0)