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
oxigraph-main
JUBIN CHHEDA 2 years ago committed by Facebook GitHub Bot
parent 94c247bff8
commit b14c0b0602
  1. 2
      cache/secondary_cache_adapter.cc

@ -376,7 +376,7 @@ void CacheWithSecondaryAdapter::WaitAll(AsyncLookupHandle* async_handles,
for (AsyncLookupHandle* cur : my_pending) { for (AsyncLookupHandle* cur : my_pending) {
my_secondary_handles.push_back(cur->pending_handle); my_secondary_handles.push_back(cur->pending_handle);
} }
secondary_cache_->WaitAll(my_secondary_handles); secondary_cache_->WaitAll(std::move(my_secondary_handles));
} }
// Process results // Process results

Loading…
Cancel
Save