From 4d78048b9f10b65d6ec0e44b52b41f8838992e34 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Mon, 17 Mar 2025 10:38:02 -0700 Subject: [PATCH] Remove unused exception parameter from faiss/impl/ResultHandler.h Summary: `-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it. This: ``` try { ... } catch (exception& e) { // no use of e } ``` should instead be written as ``` } catch (exception&) { ``` If the code compiles, this is safe to land. Reviewed By: dtolnay Differential Revision: D71290934 --- faiss/impl/ResultHandler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/faiss/impl/ResultHandler.h b/faiss/impl/ResultHandler.h index 68574df0dc..ce15c63510 100644 --- a/faiss/impl/ResultHandler.h +++ b/faiss/impl/ResultHandler.h @@ -534,7 +534,7 @@ struct RangeSearchBlockResultHandler : BlockResultHandler { try { // finalize the partial result pres.finalize(); - } catch (const faiss::FaissException& e) { + } catch ([[maybe_unused]] const faiss::FaissException& e) { // Do nothing if allocation fails in finalizing partial results. #ifndef NDEBUG std::cerr << e.what() << std::endl; @@ -598,7 +598,7 @@ struct RangeSearchBlockResultHandler : BlockResultHandler { if (partial_results.size() > 0) { RangeSearchPartialResult::merge(partial_results); } - } catch (const faiss::FaissException& e) { + } catch ([[maybe_unused]] const faiss::FaissException& e) { // Do nothing if allocation fails in merge. #ifndef NDEBUG std::cerr << e.what() << std::endl;