diff options
author | Tor Egge <Tor.Egge@online.no> | 2024-05-19 22:52:22 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2024-05-19 22:52:22 +0200 |
commit | 7d057ea51f67675b8214e99c64c0729471aa5dd3 (patch) | |
tree | 6a617f9f0d7ed5c11683fa799e4a605dabce988e /document | |
parent | 6e3cc46cf6717b58ab658d1efe6b44df0dbae77a (diff) |
Use const auto* to indicate that variable is a pointer.
Diffstat (limited to 'document')
5 files changed, 8 insertions, 8 deletions
diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index 23b998d6800..9da03d6001b 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -808,7 +808,7 @@ makeTensorFieldValue(const TensorSpec &spec, const TensorDataType &dataType) const vespalib::eval::Value &asTensor(const FieldValue &fieldValue) { auto &tensorFieldValue = dynamic_cast<const TensorFieldValue &>(fieldValue); - auto tensor = tensorFieldValue.getAsTensorPtr(); + const auto* tensor = tensorFieldValue.getAsTensorPtr(); assert(tensor); return *tensor; } diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp index 4a1af74d048..d309615e186 100644 --- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp +++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp @@ -320,7 +320,7 @@ VespaDocumentSerializer::write(const WeightedSetFieldValue &value) { void VespaDocumentSerializer::write(const TensorFieldValue &value) { vespalib::nbostream tmpStream; - auto tensor = value.getAsTensorPtr(); + const auto* tensor = value.getAsTensorPtr(); if (tensor) { encode_value(*tensor, tmpStream); assert( ! tmpStream.empty()); diff --git a/document/src/vespa/document/update/tensor_add_update.cpp b/document/src/vespa/document/update/tensor_add_update.cpp index f7223b6b831..2426db5ae44 100644 --- a/document/src/vespa/document/update/tensor_add_update.cpp +++ b/document/src/vespa/document/update/tensor_add_update.cpp @@ -71,7 +71,7 @@ std::unique_ptr<vespalib::eval::Value> TensorAddUpdate::apply_to(const Value &old_tensor, const ValueBuilderFactory &factory) const { - if (auto addTensor = _tensor->getAsTensorPtr()) { + if (const auto* addTensor = _tensor->getAsTensorPtr()) { return TensorPartialUpdate::add(old_tensor, *addTensor, factory); } return {}; @@ -83,7 +83,7 @@ TensorAddUpdate::applyTo(FieldValue& value) const if (value.isA(FieldValue::Type::TENSOR)) { TensorFieldValue &tensorFieldValue = static_cast<TensorFieldValue &>(value); tensorFieldValue.make_empty_if_not_existing(); - auto oldTensor = tensorFieldValue.getAsTensorPtr(); + const auto* oldTensor = tensorFieldValue.getAsTensorPtr(); assert(oldTensor); auto newTensor = applyTo(*oldTensor); if (newTensor) { diff --git a/document/src/vespa/document/update/tensor_modify_update.cpp b/document/src/vespa/document/update/tensor_modify_update.cpp index 94d57ee0658..1070cc286ca 100644 --- a/document/src/vespa/document/update/tensor_modify_update.cpp +++ b/document/src/vespa/document/update/tensor_modify_update.cpp @@ -158,7 +158,7 @@ std::unique_ptr<Value> TensorModifyUpdate::apply_to(const Value &old_tensor, const ValueBuilderFactory &factory) const { - if (auto cellsTensor = _tensor->getAsTensorPtr()) { + if (const auto* cellsTensor = _tensor->getAsTensorPtr()) { auto op = getJoinFunction(_operation); if (_default_cell_value.has_value()) { return TensorPartialUpdate::modify_with_defaults(old_tensor, op, *cellsTensor, _default_cell_value.value(), factory); @@ -186,7 +186,7 @@ TensorModifyUpdate::applyTo(FieldValue& value) const { if (value.isA(FieldValue::Type::TENSOR)) { TensorFieldValue &tensorFieldValue = static_cast<TensorFieldValue &>(value); - auto old_tensor = tensorFieldValue.getAsTensorPtr(); + const auto* old_tensor = tensorFieldValue.getAsTensorPtr(); std::unique_ptr<Value> new_tensor; if (old_tensor) { new_tensor = applyTo(*old_tensor); diff --git a/document/src/vespa/document/update/tensor_remove_update.cpp b/document/src/vespa/document/update/tensor_remove_update.cpp index b9bbd96f1a2..230c451c81c 100644 --- a/document/src/vespa/document/update/tensor_remove_update.cpp +++ b/document/src/vespa/document/update/tensor_remove_update.cpp @@ -88,7 +88,7 @@ std::unique_ptr<vespalib::eval::Value> TensorRemoveUpdate::apply_to(const Value &old_tensor, const ValueBuilderFactory &factory) const { - if (auto addressTensor = _tensor->getAsTensorPtr()) { + if (const auto* addressTensor = _tensor->getAsTensorPtr()) { return TensorPartialUpdate::remove(old_tensor, *addressTensor, factory); } return {}; @@ -99,7 +99,7 @@ TensorRemoveUpdate::applyTo(FieldValue &value) const { if (value.isA(FieldValue::Type::TENSOR)) { TensorFieldValue &tensorFieldValue = static_cast<TensorFieldValue &>(value); - auto oldTensor = tensorFieldValue.getAsTensorPtr(); + const auto* oldTensor = tensorFieldValue.getAsTensorPtr(); if (oldTensor) { auto newTensor = applyTo(*oldTensor); if (newTensor) { |