| 1162 | } |
| 1163 | |
| 1164 | bool ScalarEquals(const Scalar& left, const Scalar& right, const EqualOptions& options) { |
| 1165 | if (&left == &right && IdentityImpliesEquality(*left.type, options)) { |
| 1166 | return true; |
| 1167 | } |
| 1168 | if (!left.type->Equals(right.type)) { |
| 1169 | return false; |
| 1170 | } |
| 1171 | if (left.is_valid != right.is_valid) { |
| 1172 | return false; |
| 1173 | } |
| 1174 | if (!left.is_valid) { |
| 1175 | return true; |
| 1176 | } |
| 1177 | ScalarEqualsVisitor visitor(right, options); |
| 1178 | auto error = VisitScalarInline(left, &visitor); |
| 1179 | DCHECK_OK(error); |
| 1180 | return visitor.result(); |
| 1181 | } |
| 1182 | |
| 1183 | bool ScalarApproxEquals(const Scalar& left, const Scalar& right, |
| 1184 | const EqualOptions& options) { |
no test coverage detected