Skip to content

Commit 84ddcfb

Browse files
authored
infer.cpp: only perform remove_if() call in infer() if actually required (#6622)
1 parent d03d820 commit 84ddcfb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/infer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,10 @@ std::vector<ValueFlow::Value> infer(const ValuePtr<InferModel>& model,
293293
return !model->match(value);
294294
};
295295
lhsValues.remove_if(notMatch);
296+
if (lhsValues.empty())
297+
return result;
296298
rhsValues.remove_if(notMatch);
297-
if (lhsValues.empty() || rhsValues.empty())
299+
if (rhsValues.empty())
298300
return result;
299301

300302
Interval lhs = Interval::fromValues(lhsValues);

0 commit comments

Comments
 (0)