Reorder checks, remove duplicate check
This commit is contained in:
parent
f4ddf43cba
commit
82825ab721
|
@ -490,17 +490,14 @@ static bool alwaysTrue(const Token *tok)
|
|||
if (!tok)
|
||||
return false;
|
||||
if (tok->values().size() == 1U &&
|
||||
tok->values().front().intvalue != 0 &&
|
||||
tok->values().front().isKnown())
|
||||
tok->values().front().isKnown() &&
|
||||
tok->values().front().intvalue != 0)
|
||||
return true;
|
||||
if (tok->str() == "||")
|
||||
return alwaysTrue(tok->astOperand1()) || alwaysTrue(tok->astOperand2());
|
||||
if (tok->str() == "true")
|
||||
return true;
|
||||
return (tok->isComparisonOp() &&
|
||||
tok->values().size() == 1U &&
|
||||
tok->values().front().isKnown() &&
|
||||
tok->values().front().intvalue != 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CheckMemoryLeakInFunction::test_white_list(const std::string &funcname, const Settings *settings, bool cpp)
|
||||
|
|
Loading…
Reference in New Issue