Related to previous commit: reduce scope level, remove the now redundant check.
This commit is contained in:
parent
60de3e75af
commit
72666e10d1
|
@ -2235,7 +2235,8 @@ void CheckOther::checkComparisonOfFuncReturningBool()
|
|||
if (!scope->isExecutable())
|
||||
continue;
|
||||
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||
if (tok->previous() && tok->type() == Token::eComparisonOp && tok->str() != "==" && tok->str() != "!=") {
|
||||
if (tok->type() != Token::eComparisonOp || tok->str() == "==" || tok->str() == "!=")
|
||||
continue;
|
||||
const Token *first_token;
|
||||
bool first_token_func_of_type_bool = false;
|
||||
if (Token::simpleMatch(tok->previous(), ")")) {
|
||||
|
@ -2271,7 +2272,6 @@ void CheckOther::checkComparisonOfFuncReturningBool()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckOther::comparisonOfFuncReturningBoolError(const Token *tok, const std::string &expression)
|
||||
|
@ -2315,7 +2315,8 @@ void CheckOther::checkComparisonOfBoolWithBool()
|
|||
if (!scope->isExecutable())
|
||||
continue;
|
||||
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||
if (tok->previous() && tok->type() == Token::eComparisonOp && tok->str() != "==" && tok->str() != "!=") {
|
||||
if (tok->type() != Token::eComparisonOp || tok->str() == "==" || tok->str() == "!=")
|
||||
continue;
|
||||
bool first_token_bool = false;
|
||||
bool second_token_bool = false;
|
||||
|
||||
|
@ -2336,7 +2337,6 @@ void CheckOther::checkComparisonOfBoolWithBool()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CheckOther::comparisonOfBoolWithBoolError(const Token *tok, const std::string &expression)
|
||||
|
|
Loading…
Reference in New Issue