From b14c0b0602341c15b161bd1163857b0724b7bf89 Mon Sep 17 00:00:00 2001 From: JUBIN CHHEDA Date: Tue, 27 Jun 2023 10:42:42 -0700 Subject: [PATCH] Update secondary_cache_adapter.cc (#11566) Summary: Infer detected a(n) [Unnecessary Copy Intermediate](https://fbinfer.com/docs/next/all-issue-types#unnecessary copy intermediate) issue. variable &my_secondary_handles is copied unnecessarily into an intermediate on line 268. To avoid the copy, try moving it by calling std::move instead or alternatively change the callee's parameter type to const &. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11566 Reviewed By: akankshamahajan15 Differential Revision: D47057361 Pulled By: ajkr fbshipit-source-id: bc5d7a71638aecbf976f1a163128b489c9e87fd8 --- cache/secondary_cache_adapter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/secondary_cache_adapter.cc b/cache/secondary_cache_adapter.cc index ff6334d07..06441a17a 100644 --- a/cache/secondary_cache_adapter.cc +++ b/cache/secondary_cache_adapter.cc @@ -376,7 +376,7 @@ void CacheWithSecondaryAdapter::WaitAll(AsyncLookupHandle* async_handles, for (AsyncLookupHandle* cur : my_pending) { my_secondary_handles.push_back(cur->pending_handle); } - secondary_cache_->WaitAll(my_secondary_handles); + secondary_cache_->WaitAll(std::move(my_secondary_handles)); } // Process results