aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-01-12 14:25:31 +0000
committerArne Juul <arnej@verizonmedia.com>2021-01-12 14:28:07 +0000
commitf5a24c0ffd9dbb2e4fa5a325562c5a016ed027e0 (patch)
tree0e238e458a13b6976dbc33ac85e5cd9940f4ceca /searchcore/src
parent00df4dedab5ea94283cbd2d2f359b01774402ffb (diff)
avoid extra Value copy when updating DirectTensorAttribute
Diffstat (limited to 'searchcore/src')
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp8
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);
}
}