From b34d7c5ff7a32c0dea57994ba5e715957edebdf0 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Fri, 12 Sep 2014 13:46:16 +0200 Subject: [PATCH] Coding style. --- core/metautils/src/SelectionRules.cxx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/core/metautils/src/SelectionRules.cxx b/core/metautils/src/SelectionRules.cxx index 9eb25b2..86efb15 100644 --- a/core/metautils/src/SelectionRules.cxx +++ b/core/metautils/src/SelectionRules.cxx @@ -865,31 +865,23 @@ const BaseSelectionRule *SelectionRules::IsVarSelected(clang::VarDecl* D, const return selector; } -const BaseSelectionRule *SelectionRules::IsFunSelected(clang::FunctionDecl* D, const std::string& qual_name) const +const BaseSelectionRule *SelectionRules::IsFunSelected(clang::FunctionDecl *D, const std::string &qual_name) const { - std::list::const_iterator it; - std::list::const_iterator it_end; std::string prototype; - GetFunctionPrototype(D, prototype); prototype = qual_name + prototype; -#ifdef SELECTION_DEBUG - std::cout<<"\tIn isFunSelected()"<Match(llvm::dyn_cast(D), qual_name, prototype, false)) { - if (it->GetSelected() == BaseSelectionRule::kNo) { + for (const auto & rule : fFunctionSelectionRules) { + if (BaseSelectionRule::kNoMatch != rule.Match(D, qual_name, prototype, false)) { + if (rule.GetSelected() == BaseSelectionRule::kNo) { // The rule did explicitly request to not select this entity. - return 0; + return nullptr; } else { - selector = &(*it); + selector = &(rule); } } } -- 1.8.2