From 6ac6f3989408b54c6baefc19d1badaa35bfde4e2 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Wed, 25 Nov 2015 18:34:36 -0800 Subject: [PATCH] use current_group() helper --- parser/parser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parser/parser.cpp b/parser/parser.cpp index f478d1c5..2753fbd8 100644 --- a/parser/parser.cpp +++ b/parser/parser.cpp @@ -154,20 +154,20 @@ struct ParserState void apply_or() { - Predicate &group = *group_stack.back(); - if (group.type == Predicate::Type::Or) { + Predicate *group = current_group(); + if (group->type == Predicate::Type::Or) { return; } // convert to OR - group.type = Predicate::Type::Or; - if (group.cpnd.sub_predicates.size() > 2) { + group->type = Predicate::Type::Or; + if (group->cpnd.sub_predicates.size() > 2) { // split the current group into an AND group ORed with the last subpredicate Predicate new_sub(Predicate::Type::And); - new_sub.cpnd.sub_predicates = std::move(group.cpnd.sub_predicates); + new_sub.cpnd.sub_predicates = std::move(group->cpnd.sub_predicates); - group.cpnd.sub_predicates = { new_sub, std::move(new_sub.cpnd.sub_predicates.back()) }; - group.cpnd.sub_predicates[0].cpnd.sub_predicates.pop_back(); + group->cpnd.sub_predicates = { new_sub, std::move(new_sub.cpnd.sub_predicates.back()) }; + group->cpnd.sub_predicates[0].cpnd.sub_predicates.pop_back(); } }