summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-28 10:41:04 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-03-28 10:41:04 +0000
commit0ef5980e8551e1684f4c5253ede87dcad887eac1 (patch)
treeab75a3e88c9b76629b3fcc9763c5779eb5a2e1f5 /searchcore
parent02b5efaa3bbc043e50e2c64b968241f842c3cffc (diff)
Use both lvalue and rvalue specifier to avoid explicit std::move()
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/attribute/attribute_test.cpp18
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp2
-rw-r--r--searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/bmcluster/bm_feed.cpp2
4 files changed, 13 insertions, 13 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp
index e64045853d4..51bc60d3783 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(std::move(FieldUpdate(upd.getType().getField("a1"))
- .addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 5))));
- upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a2"))
- .addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10))));
+ upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
+ .addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 5)));
+ upd.addUpdate(FieldUpdate(upd.getType().getField("a2"))
+ .addUpdate(std::make_unique<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(std::move(FieldUpdate(upd.getType().getField("a1"))
- .addUpdate(std::make_unique<AssignValueUpdate>(new_value))));
+ upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
+ .addUpdate(std::make_unique<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(std::move(FieldUpdate(upd.getType().getField("a1"))
- .addUpdate(std::make_unique<AssignValueUpdate>(new_value))));
+ upd.addUpdate(FieldUpdate(upd.getType().getField("a1"))
+ .addUpdate(std::make_unique<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(std::move(FieldUpdate(upd->getType().getField("a1")).addUpdate(std::make_unique<AssignValueUpdate>(tensor_value))));
+ upd->addUpdate(FieldUpdate(upd->getType().getField("a1")).addUpdate(std::make_unique<AssignValueUpdate>(tensor_value)));
return upd;
}
void expect_shared_executor_tasks(size_t exp_accepted_tasks) {
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index 8affdde8562..6cd92dea516 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -345,7 +345,7 @@ struct UpdateContext {
} else {
fieldValue->assign(document::StringFieldValue("new value"));
}
- update->addUpdate(std::move(document::FieldUpdate(field).addUpdate(std::make_unique<document::AssignValueUpdate>(*fieldValue))));
+ update->addUpdate(document::FieldUpdate(field).addUpdate(std::make_unique<document::AssignValueUpdate>(*fieldValue)));
}
};
diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
index 36920f52254..40332157a8d 100644
--- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
+++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
@@ -121,8 +121,8 @@ public:
auto makeUpdate() {
auto upd(std::make_shared<DocumentUpdate>(*_repo, _docType, docId));
- upd->addUpdate(std::move(FieldUpdate(upd->getType().getField("string")).
- addUpdate(std::make_unique<AssignValueUpdate>(StringFieldValue("newval")))));
+ upd->addUpdate(FieldUpdate(upd->getType().getField("string")).
+ addUpdate(std::make_unique<AssignValueUpdate>(StringFieldValue("newval"))));
return upd;
}
auto makeDoc() {
diff --git a/searchcore/src/vespa/searchcore/bmcluster/bm_feed.cpp b/searchcore/src/vespa/searchcore/bmcluster/bm_feed.cpp
index c8a7f3336e0..2dcf18f9da6 100644
--- a/searchcore/src/vespa/searchcore/bmcluster/bm_feed.cpp
+++ b/searchcore/src/vespa/searchcore/bmcluster/bm_feed.cpp
@@ -71,7 +71,7 @@ BmFeed::make_document_update(uint32_t n, uint32_t i) const
{
auto id = make_document_id(n, i);
auto document_update = std::make_unique<DocumentUpdate>(*_repo, *_document_type, id);
- document_update->addUpdate(std::move(FieldUpdate(_field).addUpdate(std::make_unique<AssignValueUpdate>(IntFieldValue(15)))));
+ document_update->addUpdate(FieldUpdate(_field).addUpdate(std::make_unique<AssignValueUpdate>(IntFieldValue(15))));
return document_update;
}