Break loop early
This commit is contained in:
parent
46c6620691
commit
b9c2a996bf
|
@ -2638,8 +2638,12 @@ void Tokenizer::setVarIdPass1()
|
||||||
scopeStack.push(VarIdScopeInfo(isExecutable, scopeStack.top().isStructInit || tok->strAt(-1) == "=", isEnumStart(tok), _varId));
|
scopeStack.push(VarIdScopeInfo(isExecutable, scopeStack.top().isStructInit || tok->strAt(-1) == "=", isEnumStart(tok), _varId));
|
||||||
} else { /* if (tok->str() == "}") */
|
} else { /* if (tok->str() == "}") */
|
||||||
bool isNamespace = false;
|
bool isNamespace = false;
|
||||||
for (const Token *tok1 = tok->link()->previous(); tok1 && tok1->isName(); tok1 = tok1->previous())
|
for (const Token *tok1 = tok->link()->previous(); tok1 && tok1->isName(); tok1 = tok1->previous()) {
|
||||||
isNamespace |= (tok1->str() == "namespace");
|
if (tok1->str() == "namespace") {
|
||||||
|
isNamespace = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Set variable ids in class declaration..
|
// Set variable ids in class declaration..
|
||||||
if (!initlist && !isC() && !scopeStack.top().isExecutable && tok->link() && !isNamespace) {
|
if (!initlist && !isC() && !scopeStack.top().isExecutable && tok->link() && !isNamespace) {
|
||||||
setVarIdClassDeclaration(tok->link(),
|
setVarIdClassDeclaration(tok->link(),
|
||||||
|
|
Loading…
Reference in New Issue