diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-09-27 11:20:33 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-09-27 11:20:33 +0200 |
commit | 7c65b5500e4e7680e72a6403f284b9757f1879ee (patch) | |
tree | f1a6b94a544e5085292a657ea34b71522ac5b566 /searchcore | |
parent | 83c97aaad8bdfd6cc11b49be4a542e179cda1b4f (diff) |
Move ownership of MatchingElements to GetDocsumsState.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp | 8 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.h | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp index f3559b54eb4..c65257e7f6a 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.cpp @@ -147,8 +147,7 @@ DocsumContext::DocsumContext(const DocsumRequest & request, IDocsumWriter & docs _attrCtx(attrCtx), _attrMgr(attrMgr), _docsumState(*this), - _sessionMgr(sessionMgr), - _matching_elements() + _sessionMgr(sessionMgr) { initState(); } @@ -215,11 +214,10 @@ DocsumContext::ParseLocation(search::docsummary::GetDocsumsState *state) state->_parsedLocation.reset(getLocation(_request.location, _attrMgr)); } -const MatchingElements& +std::unique_ptr<MatchingElements> DocsumContext::fill_matching_elements() { - _matching_elements = std::make_unique<MatchingElements>(); - return *_matching_elements; + return std::make_unique<MatchingElements>(); } } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.h b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.h index ec03efdd650..30b5ef16cb1 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.h +++ b/searchcore/src/vespa/searchcore/proton/docsummary/docsumcontext.h @@ -25,7 +25,6 @@ private: search::IAttributeManager & _attrMgr; search::docsummary::GetDocsumsState _docsumState; matching::SessionManager & _sessionMgr; - std::unique_ptr<search::MatchingElements> _matching_elements; void initState(); search::engine::DocsumReply::UP createReply(); @@ -49,7 +48,7 @@ public: void FillSummaryFeatures(search::docsummary::GetDocsumsState * state, search::docsummary::IDocsumEnvironment * env) override; void FillRankFeatures(search::docsummary::GetDocsumsState * state, search::docsummary::IDocsumEnvironment * env) override; void ParseLocation(search::docsummary::GetDocsumsState * state) override; - const search::MatchingElements& fill_matching_elements() override; + std::unique_ptr<search::MatchingElements> fill_matching_elements() override; }; } // namespace proton |