Skip to content

Commit a651069

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Remove unused variables in faiss/impl/index_read.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: algoriddle Differential Revision: D52981028 fbshipit-source-id: dbdf5c56e1d594e534183483c236ed2f08f98857
1 parent e19de27 commit a651069

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

faiss/impl/index_read.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,12 @@ static void read_NSG(NSG* nsg, IOReader* f) {
398398
graph = std::make_shared<nsg::Graph<int>>(N, R);
399399
std::fill_n(graph->data, N * R, EMPTY_ID);
400400

401-
int size = 0;
402-
403401
for (int i = 0; i < N; i++) {
404402
for (int j = 0; j < R + 1; j++) {
405403
int id;
406404
READ1(id);
407405
if (id != EMPTY_ID) {
408406
graph->at(i, j) = id;
409-
size += 1;
410407
} else {
411408
break;
412409
}

0 commit comments

Comments
 (0)