summaryrefslogtreecommitdiffstats
path: root/searchsummary/src
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-04-19 11:53:50 +0000
committerGeir Storli <geirst@oath.com>2018-04-19 11:56:30 +0000
commit33ef61f554a5768c4457e78207c689fbf5661220 (patch)
treeb33ee25db5ff23fb800badd1fc47bd78309b1b55 /searchsummary/src
parent939a0c130bbcea1cc5fb743711c7a021f467fcae (diff)
Add type-safe down-cast to ITensorAttribute in IAttributeVector and use this instead of dynamic_cast.
Diffstat (limited to 'searchsummary/src')
-rw-r--r--searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp
index a15e0e0e0c0..5e8e4ee0584 100644
--- a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp
+++ b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp
@@ -136,9 +136,8 @@ SingleAttrDFW::insertField(uint32_t docid,
BasicType::Type t = v.getBasicType();
switch (t) {
case BasicType::TENSOR: {
- const tensor::ITensorAttribute &tv =
- dynamic_cast<const tensor::ITensorAttribute &>(v);
- const auto tensor = tv.getTensor(docid);
+ const tensor::ITensorAttribute *tv = v.asTensorAttribute();
+ const auto tensor = tv->getTensor(docid);
if (tensor) {
vespalib::nbostream str;
vespalib::tensor::TypedBinaryFormat::serialize(str, *tensor);