Skip to content

Commit eeb1086

Browse files
committed
Avoid string comparison
1 parent 2ab0a7b commit eeb1086

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/programmemory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static ValueFlow::Value evaluate(const Token* op, const ValueFlow::Value& lhs, c
675675
// If not the same type then one must be int
676676
if (lhs.valueType != rhs.valueType && !lhs.isIntValue() && !rhs.isIntValue())
677677
return ValueFlow::Value::unknown();
678-
const bool compareOp = contains({"==", "!=", "<", ">", ">=", "<="}, opStr);
678+
const bool compareOp = op->isComparisonOp();
679679
// Comparison must be the same type
680680
if (compareOp && lhs.valueType != rhs.valueType)
681681
return ValueFlow::Value::unknown();

0 commit comments

Comments
 (0)