summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-13 17:07:58 +0100
committerGitHub <noreply@github.com>2017-01-13 17:07:58 +0100
commite8b6dca771a16a1a0694f2218d58a35ad51def08 (patch)
tree09ca5d94e9152fe119a45fb149ea2b5a5583f3cb /searchcore
parent695c94232604042f5530535d4a803fb706d59937 (diff)
parentc3d84809d8af12339b8d32673fc4b93d0bcbf6d1 (diff)
Merge pull request #1511 from yahoo/balder/move-guard-down
Move the guard to get the names too.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_master.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
index 40b05001a2e..08bf2029e18 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
@@ -108,9 +108,6 @@ FeatureSet::SP
MatchMaster::getFeatureSet(const MatchToolsFactory &matchToolsFactory,
const std::vector<uint32_t> &docs, bool summaryFeatures)
{
- if (docs.empty()) {
- return std::make_shared<FeatureSet>();
- }
MatchTools::UP matchTools = matchToolsFactory.createMatchTools();
RankProgram::UP rankProgram = summaryFeatures ? matchTools->summary_program() :
matchTools->dump_program();
@@ -122,6 +119,9 @@ MatchMaster::getFeatureSet(const MatchToolsFactory &matchToolsFactory,
featureNames.emplace_back(resolver.name_of(i));
}
FeatureSet::SP retval(new FeatureSet(featureNames, docs.size()));
+ if (docs.empty()) {
+ return retval;
+ }
FeatureSet &fs = *retval.get();
SearchIterator::UP search = matchTools->createSearch(rankProgram->match_data());