summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-09-05 08:22:46 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-05 12:40:19 +0000
commit5b29d1cbb2df9e486a55d1a87aece81c7b5a9780 (patch)
tree9b06439296d5f187ddbb3bd8baf57a0cee18b10b
parent8a86a51758f4913fd21f01408a402e5a6f787ea5 (diff)
downloadmongo-5b29d1cbb2df9e486a55d1a87aece81c7b5a9780.tar.gz
SERVER-50275 fix use-after-move
-rw-r--r--src/mongo/db/update/v2_log_builder_test.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/update/v2_log_builder_test.cpp b/src/mongo/db/update/v2_log_builder_test.cpp
index 37e82f48061..325c00dc573 100644
--- a/src/mongo/db/update/v2_log_builder_test.cpp
+++ b/src/mongo/db/update/v2_log_builder_test.cpp
@@ -63,10 +63,9 @@ RuntimeUpdatePath makeRuntimeUpdatePathAssumeNumericComponentsAreIndexes(StringD
*/
RuntimeUpdatePath makeRuntimeUpdatePathAssumeAllComponentsFieldNames(std::string path) {
FieldRef fieldRef(path);
- return RuntimeUpdatePath(
- std::move(fieldRef),
- std::vector<RuntimeUpdatePath::ComponentType>(
- fieldRef.numParts(), RuntimeUpdatePath::ComponentType::kFieldName));
+ RuntimeUpdatePath::ComponentTypeVector types(fieldRef.numParts(),
+ RuntimeUpdatePath::ComponentType::kFieldName);
+ return RuntimeUpdatePath(std::move(fieldRef), std::move(types));
}
TEST(V2LogBuilder, UpdateFieldWithTopLevelMutableBsonElement) {