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()) {
|
for (Token *tok3 = tok2; tok3; tok3 = tok3->next()) {
|
||||||
++typelen;
|
++typelen;
|
||||||
|
|
||||||
if (tok3->str() == "<" && !parens) {
|
if (!parens && tok3->str() == "<") {
|
||||||
++indentlevel;
|
++indentlevel;
|
||||||
} else if (tok3->str() == ">" && !parens) {
|
} else if (!parens && tok3->str() == ">") {
|
||||||
if (indentlevel == 0) {
|
if (indentlevel == 0) {
|
||||||
tok2 = tok3->next();
|
tok2 = tok3->next();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
--indentlevel;
|
--indentlevel;
|
||||||
} else if (tok3->str() == ">>" && !parens) {
|
} else if (!parens && tok3->str() == ">>") {
|
||||||
if (indentlevel <= 1U) {
|
if (indentlevel <= 1U) {
|
||||||
tok2 = tok3->next();
|
tok2 = tok3->next();
|
||||||
break;
|
break;
|
||||||
|
@ -5488,11 +5488,12 @@ void Tokenizer::simplifyPlatformTypes()
|
||||||
type = isLong;
|
type = isLong;
|
||||||
else
|
else
|
||||||
type = isLongLong;
|
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;
|
type = isLong;
|
||||||
else if (_settings->sizeof_size_t == 4)
|
|
||||||
type = isInt;
|
|
||||||
else
|
else
|
||||||
|
type = isInt;
|
||||||
|
} else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||||
|
|
Loading…
Reference in New Issue