summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/persistence/persistencetestutils.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-27 14:05:51 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-03-27 14:05:51 +0000
commit3112b96dcd66e8aed0587d44288ca8e347cc31a2 (patch)
treed537c0d2135604a46feb767a7a7e1986f3813dfd /storage/src/tests/persistence/persistencetestutils.cpp
parentf1ca88107239ff1ba6bf0f7e142486352ffd90e4 (diff)
Avoid need to copy/clone FieldUpdate
Diffstat (limited to 'storage/src/tests/persistence/persistencetestutils.cpp')
-rw-r--r--storage/src/tests/persistence/persistencetestutils.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/storage/src/tests/persistence/persistencetestutils.cpp b/storage/src/tests/persistence/persistencetestutils.cpp
index 6974319dc72..0adeff5bc34 100644
--- a/storage/src/tests/persistence/persistencetestutils.cpp
+++ b/storage/src/tests/persistence/persistencetestutils.cpp
@@ -226,9 +226,7 @@ PersistenceTestUtils::createBodyUpdate(const document::DocumentId& docId, const
const DocumentType* docType(getTypeRepo()->getDocumentType("testdoctype1"));
auto update = std::make_shared<document::DocumentUpdate>(*getTypeRepo(), *docType, docId);
auto assignUpdate = std::make_shared<document::AssignValueUpdate>(updateValue);
- document::FieldUpdate fieldUpdate(docType->getField("content"));
- fieldUpdate.addUpdate(*assignUpdate);
- update->addUpdate(fieldUpdate);
+ update->addUpdate(std::move(document::FieldUpdate(docType->getField("content")).addUpdate(*assignUpdate)));
return update;
}
@@ -238,9 +236,7 @@ PersistenceTestUtils::createHeaderUpdate(const document::DocumentId& docId, cons
const DocumentType* docType(getTypeRepo()->getDocumentType("testdoctype1"));
auto update = std::make_shared<document::DocumentUpdate>(*getTypeRepo(), *docType, docId);
auto assignUpdate = std::make_shared<document::AssignValueUpdate>(updateValue);
- document::FieldUpdate fieldUpdate(docType->getField("headerval"));
- fieldUpdate.addUpdate(*assignUpdate);
- update->addUpdate(fieldUpdate);
+ update->addUpdate(std::move(document::FieldUpdate(docType->getField("headerval")).addUpdate(*assignUpdate)));
return update;
}