summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-08-28 11:48:09 +0200
committerHenning Baldersheim <balder@oath.com>2018-08-28 11:48:09 +0200
commitd715fcea71e2405db5293bcb38a35d7009a9ef39 (patch)
tree7c0d46207a5865dae36019c82a7982f22a73cd54
parent3b51ab4cd987c98aaf6331857705f6cf09fce5e3 (diff)
Reduce scope to inside if() {}
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_master.cpp3
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp6
2 files changed, 3 insertions, 6 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
index 9fae955022a..a011e4b3512 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp
@@ -139,8 +139,7 @@ MatchMaster::getFeatureSet(const MatchToolsFactory &mtf,
LOG(debug, "getFeatureSet: Did not find hit for docid '%u'. Skipping hit", docs[i]);
}
}
- auto onSummaryTask = mtf.createOnSummaryTask();
- if (onSummaryTask) {
+ if (auto onSummaryTask = mtf.createOnSummaryTask()) {
onSummaryTask->run(docs);
}
return retval;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp
index 31b3e138373..8eb135e9a5c 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.cpp
@@ -280,8 +280,7 @@ MatchThread::findMatches(MatchTools &tools)
kept_hits.clear();
}
uint32_t reRanked = hits.reRank(scorer, std::move(kept_hits));
- auto onReRankTask = mtf.createOnReRankTask();
- if (onReRankTask) {
+ if (auto onReRankTask = mtf.createOnReRankTask()) {
onReRankTask->run(hits.getReRankedHits());
}
thread_stats.docsReRanked(reRanked);
@@ -351,8 +350,7 @@ MatchThread::processResult(const Doom & hardDoom,
}
}
const MatchToolsFactory & mtf = matchToolsFactory;
- auto onMatchTask = mtf.createOnMatchTask();
- if (onMatchTask ) {
+ if (auto onMatchTask = mtf.createOnMatchTask()) {
onMatchTask->run(search::ResultSet::stealResult(std::move(*result)));
}
if (hasGrouping) {