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..
|
// Simplify labels in the executable scope..
|
||||||
if (Token::Match(tok, ") const| {")) {
|
if (Token::Match(tok, ") const| {")) {
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
if (tok->str() == "const")
|
if (tok->str() != "{")
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
executablescope = true;
|
executablescope = true;
|
||||||
}
|
}
|
||||||
|
@ -2389,10 +2389,7 @@ void Tokenizer::simplifyLabelsCaseDefault()
|
||||||
if (Token::Match(tok,"[:{};]"))
|
if (Token::Match(tok,"[:{};]"))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!tok)
|
if (tok->str() == ":" && tok->next()->str() != ";") {
|
||||||
break;
|
|
||||||
else if (tok->str() == ":" &&
|
|
||||||
(!tok->next() || tok->next()->str() != ";")) {
|
|
||||||
tok->insertToken(";");
|
tok->insertToken(";");
|
||||||
}
|
}
|
||||||
} else if (Token::Match(tok, "[;{}] %var% : !!;")) {
|
} else if (Token::Match(tok, "[;{}] %var% : !!;")) {
|
||||||
|
|
Loading…
Reference in New Issue