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)
|
if (!tok)
|
||||||
return false;
|
return false;
|
||||||
if (tok->values().size() == 1U &&
|
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;
|
return true;
|
||||||
if (tok->str() == "||")
|
if (tok->str() == "||")
|
||||||
return alwaysTrue(tok->astOperand1()) || alwaysTrue(tok->astOperand2());
|
return alwaysTrue(tok->astOperand1()) || alwaysTrue(tok->astOperand2());
|
||||||
if (tok->str() == "true")
|
if (tok->str() == "true")
|
||||||
return true;
|
return true;
|
||||||
return (tok->isComparisonOp() &&
|
return false;
|
||||||
tok->values().size() == 1U &&
|
|
||||||
tok->values().front().isKnown() &&
|
|
||||||
tok->values().front().intvalue != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckMemoryLeakInFunction::test_white_list(const std::string &funcname, const Settings *settings, bool cpp)
|
bool CheckMemoryLeakInFunction::test_white_list(const std::string &funcname, const Settings *settings, bool cpp)
|
||||||
|
|
Loading…
Reference in New Issue