summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/attribute
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 /searchcore/src/tests/proton/attribute
parentf1ca88107239ff1ba6bf0f7e142486352ffd90e4 (diff)
Avoid need to copy/clone FieldUpdate
Diffstat (limited to 'searchcore/src/tests/proton/attribute')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index fdf75bbd726..a95d3f7ccca 100644
--- a/searchcore/src/tests/proton/attribute/attribute_test.cpp
+++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp
@@ -482,10 +482,10 @@ TEST_F(AttributeWriterTest, handles_update)
DocBuilder idb(schema);
const document::DocumentType &dt(idb.getDocumentType());
DocumentUpdate upd(*idb.getDocumentTypeRepo(), dt, DocumentId("id:ns:searchdocument::1"));
- upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
- .addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 5)));
- upd.addUpdate(FieldUpdate(upd.getType().getField("a2"))
- .addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10)));
+ upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a1"))
+ .addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 5))));
+ upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a2"))
+ .addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10))));
DummyFieldUpdateCallback onUpdate;
update(2, upd, 1, onUpdate);
@@ -527,8 +527,8 @@ TEST_F(AttributeWriterTest, handles_predicate_update)
const document::DocumentType &dt(idb.getDocumentType());
DocumentUpdate upd(*idb.getDocumentTypeRepo(), dt, DocumentId("id:ns:searchdocument::1"));
PredicateFieldValue new_value(builder.feature("foo").value("bar").build());
- upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
- .addUpdate(AssignValueUpdate(new_value)));
+ upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a1"))
+ .addUpdate(AssignValueUpdate(new_value))));
PredicateIndex &index = static_cast<PredicateAttribute &>(*a1).getIndex();
EXPECT_EQ(1u, index.getZeroConstraintDocs().size());
@@ -728,8 +728,8 @@ TEST_F(AttributeWriterTest, handles_tensor_assign_update)
TensorDataType xySparseTensorDataType(vespalib::eval::ValueType::from_spec(sparse_tensor));
TensorFieldValue new_value(xySparseTensorDataType);
new_value = SimpleValue::from_value(*new_tensor);
- upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
- .addUpdate(AssignValueUpdate(new_value)));
+ upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a1"))
+ .addUpdate(AssignValueUpdate(new_value))));
DummyFieldUpdateCallback onUpdate;
update(2, upd, 1, onUpdate);
EXPECT_EQ(2u, a1->getNumDocs());
@@ -938,7 +938,7 @@ public:
TensorDataType tensor_type(vespalib::eval::ValueType::from_spec(dense_tensor));
TensorFieldValue tensor_value(tensor_type);
tensor_value= SimpleValue::from_value(*tensor);
- upd->addUpdate(FieldUpdate(upd->getType().getField("a1")).addUpdate(AssignValueUpdate(tensor_value)));
+ upd->addUpdate(std::move(FieldUpdate(upd->getType().getField("a1")).addUpdate(AssignValueUpdate(tensor_value))));
return upd;
}
void expect_shared_executor_tasks(size_t exp_accepted_tasks) {