Tokenizer::setVarId: Refactoring, use continue in loops
This commit is contained in:
parent
372763c85e
commit
1d21cf5755
|
@ -2888,7 +2888,9 @@ void Tokenizer::setVarIdPass2()
|
|||
// class members..
|
||||
std::map<std::string, std::map<std::string, unsigned int> > varsByClass;
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, "namespace|class|struct %name% {|:|::")) {
|
||||
if (!Token::Match(tok, "namespace|class|struct %name% {|:|::"))
|
||||
continue;
|
||||
|
||||
std::string classname(tok->next()->str());
|
||||
const Token* tokStart = tok->tokAt(2);
|
||||
unsigned int nestedCount = 1;
|
||||
|
@ -2975,7 +2977,9 @@ void Tokenizer::setVarIdPass2()
|
|||
tok2 = tok2->linkAt(2);
|
||||
|
||||
// constructor with initializer list
|
||||
if (Token::Match(tok2, ") : ::| %name%")) {
|
||||
if (!Token::Match(tok2, ") : ::| %name%"))
|
||||
continue;
|
||||
|
||||
Token *tok3 = tok2;
|
||||
while (Token::Match(tok3, "[)}] [,:]")) {
|
||||
tok3 = tok3->tokAt(2);
|
||||
|
@ -3004,8 +3008,6 @@ void Tokenizer::setVarIdPass2()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void linkBrackets(Tokenizer* tokenizer, std::stack<const Token*>& type, std::stack<Token*>& links, Token* token, char open, char close)
|
||||
|
|
Loading…
Reference in New Issue