Skip to content

Commit de24718

Browse files
committed
refs #12861 - exit early by splitting check in ConditionHandler::traverseCondition() [skip ci]
1 parent f6e471c commit de24718

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/valueflow.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4608,9 +4608,12 @@ struct ConditionHandler {
46084608
if (conditions.empty())
46094609
continue;
46104610

4611+
if (!Token::Match(tok->astParent(), "&&|%oror%|?|!"))
4612+
continue;
4613+
46114614
const Token* top = tok->astTop();
46124615

4613-
if (!Token::Match(top->previous(), "if|while|for (") && !Token::Match(tok->astParent(), "&&|%oror%|?|!"))
4616+
if (!Token::Match(top->previous(), "if|while|for ("))
46144617
continue;
46154618
for (const Condition& cond : conditions) {
46164619
if (!cond.vartok)

0 commit comments

Comments
 (0)