Skip to content

Commit

Permalink
infer.cpp: only perform remove_if() call in infer() if actually r…
Browse files Browse the repository at this point in the history
…equired
  • Loading branch information
firewave committed Jul 21, 2024
1 parent 878fe6c commit 09cc198
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/infer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ std::vector<ValueFlow::Value> infer(const ValuePtr<InferModel>& model,
return !model->match(value);
};
lhsValues.remove_if(notMatch);
if (lhsValues.empty())
return result;
rhsValues.remove_if(notMatch);
if (lhsValues.empty() || rhsValues.empty())
if (rhsValues.empty())
return result;

Interval lhs = Interval::fromValues(lhsValues);
Expand Down

0 comments on commit 09cc198

Please sign in to comment.