diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-10-14 14:29:16 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-10-14 15:05:32 +0000 |
commit | 3d2645d8593874be4da8e5f73cd5a7e2cecfd399 (patch) | |
tree | 4cc3248c65d6abe0a56b06d71ed345ededda16c3 /searchcore | |
parent | 5ab1a8b97842b3a87fc0d3fec5cb631b1d356ab9 (diff) |
getAsTensorPtr() method can return "pointer to tensor"
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp | 4 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp index b295926c64a..5f8f7a63dd0 100644 --- a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp +++ b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp @@ -468,8 +468,8 @@ void Test::checkTensor(const Tensor::UP &tensor, const FieldValue *value) { ASSERT_TRUE(value); const TensorFieldValue *s = dynamic_cast<const TensorFieldValue *>(value); ASSERT_TRUE(s); - const Tensor::UP &tvalue = s->getAsTensorPtr(); - EXPECT_EQUAL(tensor.get() != nullptr, tvalue.get() != nullptr); + auto tvalue = s->getAsTensorPtr(); + EXPECT_EQUAL(tensor.get() != nullptr, tvalue != nullptr); if (tensor) { EXPECT_EQUAL(*tensor, *tvalue); } diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp index 080aee88f3f..0e6ce5e689b 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/documentstoreadapter.cpp @@ -86,7 +86,7 @@ DocumentStoreAdapter::writeField(const FieldValue &value, ResType type) vespalib::nbostream serialized; if (value.getClass().inherits(TensorFieldValue::classId)) { const auto &tvalue = static_cast<const TensorFieldValue &>(value); - const std::unique_ptr<Tensor> &tensor = tvalue.getAsTensorPtr(); + auto tensor = tvalue.getAsTensorPtr(); if (tensor) { vespalib::tensor::TypedBinaryFormat::serialize(serialized, *tensor); } |