Run cheaper check first, don't check the same condition twice.

This commit is contained in:
Dmitry-Me 2014-07-28 14:58:19 +04:00
parent 90bc59e0fa
commit dc03b98e60
1 changed files with 9 additions and 8 deletions

View File

@ -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)
type = isLong;
else if (_settings->sizeof_size_t == 4)
type = isInt;
else
} else if (_settings->sizeof_size_t == 4) {
if (_settings->sizeof_long == 4)
type = isLong;
else
type = isInt;
} else
return;
for (Token *tok = list.front(); tok; tok = tok->next()) {