Related to previous commit: reduce scope level, remove the now redundant check.

This commit is contained in:
Edoardo Prezioso 2012-10-02 15:19:29 +02:00
parent 60de3e75af
commit 72666e10d1
1 changed files with 46 additions and 46 deletions

View File

@ -2235,7 +2235,8 @@ void CheckOther::checkComparisonOfFuncReturningBool()
if (!scope->isExecutable()) if (!scope->isExecutable())
continue; continue;
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) { 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; const Token *first_token;
bool first_token_func_of_type_bool = false; bool first_token_func_of_type_bool = false;
if (Token::simpleMatch(tok->previous(), ")")) { if (Token::simpleMatch(tok->previous(), ")")) {
@ -2272,7 +2273,6 @@ void CheckOther::checkComparisonOfFuncReturningBool()
} }
} }
} }
}
void CheckOther::comparisonOfFuncReturningBoolError(const Token *tok, const std::string &expression) void CheckOther::comparisonOfFuncReturningBoolError(const Token *tok, const std::string &expression)
{ {
@ -2315,7 +2315,8 @@ void CheckOther::checkComparisonOfBoolWithBool()
if (!scope->isExecutable()) if (!scope->isExecutable())
continue; continue;
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) { 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 first_token_bool = false;
bool second_token_bool = false; bool second_token_bool = false;
@ -2337,7 +2338,6 @@ void CheckOther::checkComparisonOfBoolWithBool()
} }
} }
} }
}
void CheckOther::comparisonOfBoolWithBoolError(const Token *tok, const std::string &expression) void CheckOther::comparisonOfBoolWithBoolError(const Token *tok, const std::string &expression)
{ {