summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp
diff options
context:
space:
mode:
authorNikita Lapkov <nikita.lapkov@mongodb.com>2020-08-12 16:16:37 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-14 12:22:30 +0000
commit34b1c989ed6e8a3f4f6056efc81367794cfe5398 (patch)
tree9bd632e4d456ed1df7d40cfbaf2a3c7f70cf81fc /src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp
parent1097aefe26e0e381db72f0b9f3b8e1d5d0103a5a (diff)
downloadmongo-34b1c989ed6e8a3f4f6056efc81367794cfe5398.tar.gz
SERVER-42046: Remove redundant moves from query code
Since C++17 return value optimization is mandatory and no longer considered as copy elision (https://en.cppreference.com/w/cpp/language/copy_elision). This means that in some cases `return std::move(value)` can be replaced with just `return value`. We refactor Query code to remove these redundant moves. GCC 9.0.1 was used to detect such places in codebase
Diffstat (limited to 'src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp')
-rw-r--r--src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp b/src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp
index 356b7f5081d..1d83970844c 100644
--- a/src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp
+++ b/src/mongo/db/matcher/schema/expression_internal_schema_all_elem_match_from_index.cpp
@@ -52,7 +52,7 @@ std::unique_ptr<MatchExpression> InternalSchemaAllElemMatchFromIndexMatchExpress
if (getTag()) {
clone->setTag(getTag()->clone());
}
- return std::move(clone);
+ return clone;
}
bool InternalSchemaAllElemMatchFromIndexMatchExpression::equivalent(