aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-03-19 16:45:33 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-03-19 16:45:33 +0000
commit6e04e49fa9f0e15c44e68c5e68ed1abed66fc312 (patch)
tree63792b79e14894d27b7c868ef98b26119291665c /searchcore
parentfb50a2f74e981c49e9fb25fed0b0b620fca53bf7 (diff)
Follow up on review advise.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/query.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
index 3bac4746d4b..351de63de37 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp
@@ -43,15 +43,15 @@ namespace {
Node::UP
inject(Node::UP query, Node::UP to_inject) {
- if (dynamic_cast<search::query::And *>(query.get())) {
- dynamic_cast<search::query::And &>(*query).append(std::move(to_inject));
+ if (auto * my_and = dynamic_cast<search::query::And *>(query.get())) {
+ my_and->append(std::move(to_inject));
} else if (dynamic_cast<search::query::Rank *>(query.get()) || dynamic_cast<search::query::AndNot *>(query.get())) {
- search::query::Intermediate & root = dynamic_cast<search::query::Intermediate &>(*query);
+ search::query::Intermediate & root = static_cast<search::query::Intermediate &>(*query);
root.prepend(inject(root.stealFirst(), std::move(to_inject)));
} else {
auto new_root = std::make_unique<ProtonAnd>();
- new_root->append(std::move(to_inject));
new_root->append(std::move(query));
+ new_root->append(std::move(to_inject));
query = std::move(new_root);
}
return query;