diff options
author | Nikita Lapkov <nikita.lapkov@mongodb.com> | 2020-08-12 16:16:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-14 12:22:30 +0000 |
commit | 34b1c989ed6e8a3f4f6056efc81367794cfe5398 (patch) | |
tree | 9bd632e4d456ed1df7d40cfbaf2a3c7f70cf81fc /src/mongo/db/matcher/schema/expression_internal_schema_eq.cpp | |
parent | 1097aefe26e0e381db72f0b9f3b8e1d5d0103a5a (diff) | |
download | mongo-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_eq.cpp')
-rw-r--r-- | src/mongo/db/matcher/schema/expression_internal_schema_eq.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/matcher/schema/expression_internal_schema_eq.cpp b/src/mongo/db/matcher/schema/expression_internal_schema_eq.cpp index d8a5f27f789..b3a0554982c 100644 --- a/src/mongo/db/matcher/schema/expression_internal_schema_eq.cpp +++ b/src/mongo/db/matcher/schema/expression_internal_schema_eq.cpp @@ -87,7 +87,7 @@ std::unique_ptr<MatchExpression> InternalSchemaEqMatchExpression::shallowClone() if (getTag()) { clone->setTag(getTag()->clone()); } - return std::move(clone); + return clone; } } // namespace mongo |