diff options
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp b/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp index 8fb165cb0b8..4d12fdfcf5b 100644 --- a/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp @@ -205,23 +205,6 @@ AttributeUpdater::handleUpdate(PredicateAttribute &vec, uint32_t lid, const Valu } } -namespace { - -void -applyTensorUpdate(TensorAttribute &vec, uint32_t lid, const document::TensorUpdate &update, - bool create_empty_if_non_existing) -{ - auto oldTensor = vec.getTensor(lid); - if (!oldTensor && create_empty_if_non_existing) { - oldTensor = vec.getEmptyTensor(); - } - if (oldTensor) { - vec.update_tensor(lid, update, *oldTensor); - } -} - -} - template <> void AttributeUpdater::handleUpdate(TensorAttribute &vec, uint32_t lid, const ValueUpdate &upd) @@ -236,11 +219,11 @@ AttributeUpdater::handleUpdate(TensorAttribute &vec, uint32_t lid, const ValueUp updateValue(vec, lid, assign.getValue()); } } else if (op == ValueUpdate::TensorModifyUpdate) { - applyTensorUpdate(vec, lid, static_cast<const TensorModifyUpdate &>(upd), false); + vec.update_tensor(lid, static_cast<const TensorModifyUpdate &>(upd), false); } else if (op == ValueUpdate::TensorAddUpdate) { - applyTensorUpdate(vec, lid, static_cast<const TensorAddUpdate &>(upd), true); + vec.update_tensor(lid, static_cast<const TensorAddUpdate &>(upd), true); } else if (op == ValueUpdate::TensorRemoveUpdate) { - applyTensorUpdate(vec, lid, static_cast<const TensorRemoveUpdate &>(upd), false); + vec.update_tensor(lid, static_cast<const TensorRemoveUpdate &>(upd), false); } else if (op == ValueUpdate::Clear) { vec.clearDoc(lid); } else { |