From bbb6ec7e1deb0fc997f19be51985a7fd54f9e83b Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Tue, 23 Jan 2024 13:06:41 -0800 Subject: [PATCH] Remove unused variables in faiss/IndexShardsIVF.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: bunnypak, dmm-fb Differential Revision: D53011658 fbshipit-source-id: a8ba9102751def7a584167c3f50e4d02e9e6442c --- faiss/IndexShardsIVF.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/faiss/IndexShardsIVF.cpp b/faiss/IndexShardsIVF.cpp index fa6272d297..33c8f0e3e6 100644 --- a/faiss/IndexShardsIVF.cpp +++ b/faiss/IndexShardsIVF.cpp @@ -137,7 +137,6 @@ void IndexShardsIVF::add_with_ids( auto fn = [n, ids, x, nshard, d, Iq](int no, Index* index) { idx_t i0 = (idx_t)no * n / nshard; idx_t i1 = ((idx_t)no + 1) * n / nshard; - const float* x0 = x + i0 * d; auto index_ivf = dynamic_cast(index); if (index->verbose) {