Skip to content

Commit c0624d2

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Remove unused variables in faiss/invlists/OnDiskInvertedLists.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: palmje Differential Revision: D53779541 fbshipit-source-id: 7184c46a38d126debaebbda40aedcb4e9a048040
1 parent a87b432 commit c0624d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

faiss/invlists/OnDiskInvertedLists.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void OnDiskInvertedLists::update_entries(
407407
FAISS_THROW_IF_NOT(!read_only);
408408
if (n_entry == 0)
409409
return;
410-
const List& l = lists[list_no];
410+
[[maybe_unused]] const List& l = lists[list_no];
411411
assert(n_entry + offset <= l.size);
412412
idx_t* ids = const_cast<idx_t*>(get_ids(list_no));
413413
memcpy(ids + offset, ids_in, sizeof(ids_in[0]) * n_entry);

0 commit comments

Comments
 (0)