Tokenizer::simplifyLabelsCaseDefault:
use more efficient check for 'const' token;
remove redundant NULL checks thanks to commit e3bbcf501f
.
This commit is contained in:
parent
2cf75d5339
commit
9668508b32
|
@ -2362,7 +2362,7 @@ void Tokenizer::simplifyLabelsCaseDefault()
|
|||
// Simplify labels in the executable scope..
|
||||
if (Token::Match(tok, ") const| {")) {
|
||||
tok = tok->next();
|
||||
if (tok->str() == "const")
|
||||
if (tok->str() != "{")
|
||||
tok = tok->next();
|
||||
executablescope = true;
|
||||
}
|
||||
|
@ -2389,10 +2389,7 @@ void Tokenizer::simplifyLabelsCaseDefault()
|
|||
if (Token::Match(tok,"[:{};]"))
|
||||
break;
|
||||
}
|
||||
if (!tok)
|
||||
break;
|
||||
else if (tok->str() == ":" &&
|
||||
(!tok->next() || tok->next()->str() != ";")) {
|
||||
if (tok->str() == ":" && tok->next()->str() != ";") {
|
||||
tok->insertToken(";");
|
||||
}
|
||||
} else if (Token::Match(tok, "[;{}] %var% : !!;")) {
|
||||
|
|
Loading…
Reference in New Issue