From bc998019c79c83db140317c3e59761fdd12a8c5f Mon Sep 17 00:00:00 2001 From: Trevor Guidry Date: Fri, 16 Sep 2022 19:00:42 +0000 Subject: SERVER-69581 add performance-for-range-copy check to clang-tidy --- src/mongo/db/active_index_builds.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/active_index_builds.cpp') diff --git a/src/mongo/db/active_index_builds.cpp b/src/mongo/db/active_index_builds.cpp index e9041058530..b0452c0823e 100644 --- a/src/mongo/db/active_index_builds.cpp +++ b/src/mongo/db/active_index_builds.cpp @@ -161,7 +161,7 @@ std::vector> ActiveIndexBuilds::_filterInde WithLock lk, IndexBuildFilterFn indexBuildFilter) const { std::vector> indexBuilds; - for (auto pair : _allIndexBuilds) { + for (const auto& pair : _allIndexBuilds) { auto replState = pair.second; if (!indexBuildFilter(*replState)) { continue; @@ -192,7 +192,7 @@ Status ActiveIndexBuilds::registerIndexBuild( return replIndexBuildState->collectionUUID == replState.collectionUUID; }; auto collIndexBuilds = _filterIndexBuilds_inlock(lk, pred); - for (auto existingIndexBuild : collIndexBuilds) { + for (const auto& existingIndexBuild : collIndexBuilds) { for (const auto& name : replIndexBuildState->indexNames) { if (existingIndexBuild->indexNames.end() != std::find(existingIndexBuild->indexNames.begin(), -- cgit v1.2.1