Code refactoring, no functional change intended
This commit is contained in:
parent
42f075c3fa
commit
2b125e013a
|
@ -1203,7 +1203,7 @@ void CheckCondition::alwaysTrueFalse()
|
||||||
tok->astParent()
|
tok->astParent()
|
||||||
&& Token::Match(tok->astParent()->astOperand1(), "if|while")
|
&& Token::Match(tok->astParent()->astOperand1(), "if|while")
|
||||||
&& !tok->isBoolean();
|
&& !tok->isBoolean();
|
||||||
const bool constValExpr = Token::Match(tok, "%num%|%char%") && tok->astParent() && Token::Match(tok->astParent(),"&&|%oror%|?"); // just one number or char in boolean expression
|
const bool constValExpr = Token::Match(tok, "%num%|%char%") && Token::Match(tok->astParent(),"%oror%|&&|?"); // just one number or char in boolean expression
|
||||||
const bool compExpr = Token::Match(tok, "%comp%|!"); // a compare expression
|
const bool compExpr = Token::Match(tok, "%comp%|!"); // a compare expression
|
||||||
|
|
||||||
if (!(constIfWhileExpression || constValExpr || compExpr))
|
if (!(constIfWhileExpression || constValExpr || compExpr))
|
||||||
|
|
Loading…
Reference in New Issue