From: Michal Sojka Date: Sun, 20 Jan 2013 14:59:03 +0000 (+0100) Subject: Simplify the code X-Git-Url: https://rtime.felk.cvut.cz/gitweb/boost-statechart-viewer.git/commitdiff_plain/40d9480bb0ea3b83787f8d45c3cf0d754193361e?ds=sidebyside Simplify the code --- diff --git a/src/visualizer.cpp b/src/visualizer.cpp index 8bbdc55..5c932cb 100644 --- a/src/visualizer.cpp +++ b/src/visualizer.cpp @@ -314,19 +314,12 @@ public: unsigned i = 0; IdentifierInfo& II = ASTCtx->Idents.get("react"); for (DeclContext::lookup_const_result ReactRes = SrcState->lookup(DeclarationName(&II)); - ReactRes.first != ReactRes.second; ++ReactRes.first) { - if (i < reactMethodInReactions.size()) { - if (reactMethodInReactions[i] == false) { - CXXMethodDecl *React = dyn_cast(*ReactRes.first); - Diag(React->getParamDecl(0)->getLocStart(), diag_warning) - << React->getParamDecl(0)->getType().getAsString() << " missing in typedef reactions"; - } - } else { + ReactRes.first != ReactRes.second; ++ReactRes.first, ++i) { + if (i >= reactMethodInReactions.size() || reactMethodInReactions[i] == false) { CXXMethodDecl *React = dyn_cast(*ReactRes.first); - Diag(React->getParamDecl(0)->getLocStart(), diag_warning) + Diag(React->getParamDecl(0)->getLocStart(), diag_warning) << React->getParamDecl(0)->getType().getAsString() << " missing in typedef reactions"; } - i++; } }