From ea7621f3a4b46ff504bd9d24ee345e51046e5d39 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 5 Mar 2020 14:18:42 +0000 Subject: std::make_shared --- .../src/vespa/searchsummary/docsummary/attributedfw.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'searchsummary') diff --git a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp index 1ca1a336d2d..f1b12d8a227 100644 --- a/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp +++ b/searchsummary/src/vespa/searchsummary/docsummary/attributedfw.cpp @@ -5,7 +5,6 @@ #include "docsumstate.h" #include #include -#include #include #include #include @@ -40,7 +39,7 @@ AttrDFW::vec(const GetDocsumsState & s) const { class SingleAttrDFW : public AttrDFW { public: - SingleAttrDFW(const vespalib::string & attrName) : + explicit SingleAttrDFW(const vespalib::string & attrName) : AttrDFW(attrName) { } void insertField(uint32_t docid, GetDocsumsState *state, ResType type, Inserter &target) override; @@ -55,7 +54,6 @@ bool SingleAttrDFW::isDefaultValue(uint32_t docid, const GetDocsumsState * state void SingleAttrDFW::insertField(uint32_t docid, GetDocsumsState * state, ResType type, Inserter &target) { - const char *s=""; const IAttributeVector & v = vec(*state); switch (type) { case RES_INT: { @@ -116,13 +114,13 @@ SingleAttrDFW::insertField(uint32_t docid, GetDocsumsState * state, ResType type case RES_FEATUREDATA: case RES_LONG_STRING: case RES_STRING: { - s = v.getString(docid, nullptr, 0); // no need to pass in a buffer, this attribute has a string storage. + const char *s = v.getString(docid, nullptr, 0); // no need to pass in a buffer, this attribute has a string storage. target.insertString(vespalib::Memory(s)); break; } case RES_LONG_DATA: case RES_DATA: { - s = v.getString(docid, nullptr, 0); // no need to pass in a buffer, this attribute has a string storage. + const char *s = v.getString(docid, nullptr, 0); // no need to pass in a buffer, this attribute has a string storage. target.insertData(vespalib::Memory(s)); break; } @@ -138,7 +136,7 @@ SingleAttrDFW::insertField(uint32_t docid, GetDocsumsState * state, ResType type class MultiAttrDFW : public AttrDFW { public: - MultiAttrDFW(const vespalib::string & attrName) : AttrDFW(attrName) {} + explicit MultiAttrDFW(const vespalib::string & attrName) : AttrDFW(attrName) {} void insertField(uint32_t docid, GetDocsumsState *state, ResType type, Inserter &target) override; }; -- cgit v1.2.3