Skip to content

Commit e55a0ac

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Remove unused variables in faiss/impl/index_write.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: D52981052 fbshipit-source-id: 203e7ead56c69ffd77ee4a61eed1d0a502a14866
1 parent a651069 commit e55a0ac

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

faiss/impl/index_write.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,11 @@ static void write_NSG(const NSG* nsg, IOWriter* f) {
338338
FAISS_THROW_IF_NOT(K == nsg->R);
339339
FAISS_THROW_IF_NOT(true == graph->own_fields);
340340

341-
int size = 0;
342341
for (int i = 0; i < N; i++) {
343342
for (int j = 0; j < K; j++) {
344343
int id = graph->at(i, j);
345344
if (id != EMPTY_ID) {
346345
WRITE1(id);
347-
size += 1;
348346
} else {
349347
break;
350348
}

0 commit comments

Comments
 (0)