diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-01 03:43:44 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-12 02:55:41 +0100 |
commit | a549d1ded94e3e79046ce5c7a96e5c29b83eae5c (patch) | |
tree | ff1570ee6cb2bfe75879913033602fc1223c96b7 /document | |
parent | 729091a742626fdc702a66d765beff73316c1a2c (diff) |
Use value transfer instead.
Diffstat (limited to 'document')
3 files changed, 10 insertions, 9 deletions
diff --git a/document/src/vespa/document/fieldvalue/structuredfieldvalue.cpp b/document/src/vespa/document/fieldvalue/structuredfieldvalue.cpp index 9ee13c1470f..1fc54b8325f 100644 --- a/document/src/vespa/document/fieldvalue/structuredfieldvalue.cpp +++ b/document/src/vespa/document/fieldvalue/structuredfieldvalue.cpp @@ -173,10 +173,12 @@ StructuredFieldValue::onIterateNested( } using ConstCharP = const char *; -template void StructuredFieldValue::set(const vespalib::stringref & field, const int32_t & value); -template void StructuredFieldValue::set(const vespalib::stringref & field, const int64_t & value); -template void StructuredFieldValue::set(const vespalib::stringref & field, const double & value); -template void StructuredFieldValue::set(const vespalib::stringref & field, const ConstCharP & value); +template void StructuredFieldValue::set(const vespalib::stringref & field, int32_t value); +template void StructuredFieldValue::set(const vespalib::stringref & field, int64_t value); +template void StructuredFieldValue::set(const vespalib::stringref & field, double value); +template void StructuredFieldValue::set(const vespalib::stringref & field, ConstCharP value); +template void StructuredFieldValue::set(const vespalib::stringref & field, vespalib::stringref value); +template void StructuredFieldValue::set(const vespalib::stringref & field, vespalib::string value); template std::unique_ptr<MapFieldValue> StructuredFieldValue::getAs<MapFieldValue>(const Field &field) const; template std::unique_ptr<ArrayFieldValue> StructuredFieldValue::getAs<ArrayFieldValue>(const Field &field) const; diff --git a/document/src/vespa/document/fieldvalue/structuredfieldvalue.h b/document/src/vespa/document/fieldvalue/structuredfieldvalue.h index 2abeac9f1c0..e0534a6d037 100644 --- a/document/src/vespa/document/fieldvalue/structuredfieldvalue.h +++ b/document/src/vespa/document/fieldvalue/structuredfieldvalue.h @@ -149,9 +149,9 @@ public: void setValue(const vespalib::stringref & fieldName, const FieldValue& value) { setFieldValue(getField(fieldName), value); } template<typename PrimitiveType> - void set(const Field& field, const PrimitiveType& value); + void set(const Field& field, PrimitiveType value); template<typename PrimitiveType> - void set(const vespalib::stringref & fieldName, const PrimitiveType& value); + void set(const vespalib::stringref & fieldName, PrimitiveType value); size_t getSetFieldCount() const { size_t count = 0; diff --git a/document/src/vespa/document/fieldvalue/structuredfieldvalue.hpp b/document/src/vespa/document/fieldvalue/structuredfieldvalue.hpp index d02503b597a..8d86fc08165 100644 --- a/document/src/vespa/document/fieldvalue/structuredfieldvalue.hpp +++ b/document/src/vespa/document/fieldvalue/structuredfieldvalue.hpp @@ -22,7 +22,7 @@ StructuredFieldValue::getAs(const Field &field) const { template<typename PrimitiveType> void -StructuredFieldValue::set(const Field& field, const PrimitiveType& value) +StructuredFieldValue::set(const Field& field, PrimitiveType value) { FieldValue::UP fval(field.getDataType().createFieldValue()); *fval = value; @@ -31,8 +31,7 @@ StructuredFieldValue::set(const Field& field, const PrimitiveType& value) template<typename PrimitiveType> void -StructuredFieldValue::set(const vespalib::stringref & fieldName, - const PrimitiveType& value) +StructuredFieldValue::set(const vespalib::stringref & fieldName, PrimitiveType value) { set(getField(fieldName), value); } |