summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-07-20 12:20:41 +0200
committerHenning Baldersheim <balder@oath.com>2018-07-20 12:20:41 +0200
commit4becd1651e549393dd555095d99abe6f4452afd1 (patch)
tree7d261aef19052dbc23a7e67e448c94c009eb5630 /searchcore
parentd793216efc3a61bd44c136237337f9d204544d3d (diff)
Only necessary to do the cast once.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/query.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
index 46ae4b2c242..263f2b65eba 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
@@ -28,6 +28,7 @@ using search::query::Node;
using search::query::QueryTreeCreator;
using search::query::Weight;
using search::queryeval::AndBlueprint;
+using search::queryeval::RankBlueprint;
using search::queryeval::Blueprint;
using search::queryeval::IRequestContext;
using search::queryeval::SearchIterator;
@@ -126,8 +127,8 @@ Query::reserveHandles(const IRequestContext & requestContext, ISearchContext &co
LOG(debug, "original blueprint:\n%s\n", _blueprint->asString().c_str());
if (_whiteListBlueprint) {
auto andBlueprint = std::make_unique<AndBlueprint>();
- if (dynamic_cast<const search::queryeval::RankBlueprint*>(_blueprint.get())) {
- search::queryeval::RankBlueprint * rank = static_cast<search::queryeval::RankBlueprint*>(_blueprint.get());
+ RankBlueprint * rank = dynamic_cast<RankBlueprint*>(_blueprint.get());
+ if (rank != nullptr) {
(*andBlueprint)
.addChild(rank->removeChild(0))
.addChild(std::move(_whiteListBlueprint));