Commit fcc721d2 authored by charlie's avatar charlie
Browse files

Simplify conditional

parent b5768f82
......@@ -507,8 +507,9 @@ bool shape::dynamic_dimension::has_optimal() const { return opt != 0; }
bool operator==(const shape::dynamic_dimension& x, const shape::dynamic_dimension& y)
{
// don't check opt if both are fixed
bool check_opt = not(x.is_fixed() and y.is_fixed());
return (x.min == y.min and x.max == y.max and (check_opt ? x.opt == y.opt : true));
return (x.min == y.min and
x.max == y.max and
((x.is_fixed() and y.is_fixed()) or (x.opt == y.opt)));
}
bool operator!=(const shape::dynamic_dimension& x, const shape::dynamic_dimension& y)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment