Merge pull request #381 from Dmitry-Me/checkBooleanFlagFirst
Run cheaper check first, don't check the same condition twice.
This commit is contained in:
commit
905a383ac2
|
@ -5335,15 +5335,15 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_
|
|||
for (Token *tok3 = tok2; tok3; tok3 = tok3->next()) {
|
||||
++typelen;
|
||||
|
||||
if (tok3->str() == "<" && !parens) {
|
||||
if (!parens && tok3->str() == "<") {
|
||||
++indentlevel;
|
||||
} else if (tok3->str() == ">" && !parens) {
|
||||
} else if (!parens && tok3->str() == ">") {
|
||||
if (indentlevel == 0) {
|
||||
tok2 = tok3->next();
|
||||
break;
|
||||
}
|
||||
--indentlevel;
|
||||
} else if (tok3->str() == ">>" && !parens) {
|
||||
} else if (!parens && tok3->str() == ">>") {
|
||||
if (indentlevel <= 1U) {
|
||||
tok2 = tok3->next();
|
||||
break;
|
||||
|
@ -5488,11 +5488,12 @@ void Tokenizer::simplifyPlatformTypes()
|
|||
type = isLong;
|
||||
else
|
||||
type = isLongLong;
|
||||
} else if (_settings->sizeof_size_t == 4 && _settings->sizeof_long == 4)
|
||||
} else if (_settings->sizeof_size_t == 4) {
|
||||
if (_settings->sizeof_long == 4)
|
||||
type = isLong;
|
||||
else if (_settings->sizeof_size_t == 4)
|
||||
type = isInt;
|
||||
else
|
||||
type = isInt;
|
||||
} else
|
||||
return;
|
||||
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
|
|
Loading…
Reference in New Issue