diff options
author | Geir Storli <geirst@verizonmedia.com> | 2021-01-14 10:20:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 10:20:26 +0100 |
commit | 6d193ddcd446f2efa10749ef3f94d68ed02c6bab (patch) | |
tree | 1e34aa2905a1d46da197322b4cc4cf21008c6384 /searchcore | |
parent | e9ac9678864ce02a8f68679f1f0d2404fa51e474 (diff) | |
parent | f5a24c0ffd9dbb2e4fa5a325562c5a016ed027e0 (diff) |
Merge pull request #16017 from vespa-engine/arnej/avoid-value-copy
avoid extra Value copy when updating DirectTensorAttribute
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp b/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp index 063ecffe729..8fb165cb0b8 100644 --- a/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp @@ -207,9 +207,8 @@ AttributeUpdater::handleUpdate(PredicateAttribute &vec, uint32_t lid, const Valu namespace { -template <typename TensorUpdateType> void -applyTensorUpdate(TensorAttribute &vec, uint32_t lid, const TensorUpdateType &update, +applyTensorUpdate(TensorAttribute &vec, uint32_t lid, const document::TensorUpdate &update, bool create_empty_if_non_existing) { auto oldTensor = vec.getTensor(lid); @@ -217,10 +216,7 @@ applyTensorUpdate(TensorAttribute &vec, uint32_t lid, const TensorUpdateType &up oldTensor = vec.getEmptyTensor(); } if (oldTensor) { - auto newTensor = update.applyTo(*oldTensor); - if (newTensor) { - vec.setTensor(lid, *newTensor); - } + vec.update_tensor(lid, update, *oldTensor); } } |