| 1131 | } |
| 1132 | |
| 1133 | bool ScalarEquals(const Scalar& left, const Scalar& right, const EqualOptions& options, |
| 1134 | bool floating_approximate) { |
| 1135 | if (&left == &right && IdentityImpliesEquality(*left.type, options)) { |
| 1136 | return true; |
| 1137 | } |
| 1138 | if (!left.type->Equals(right.type)) { |
| 1139 | return false; |
| 1140 | } |
| 1141 | if (left.is_valid != right.is_valid) { |
| 1142 | return false; |
| 1143 | } |
| 1144 | if (!left.is_valid) { |
| 1145 | return true; |
| 1146 | } |
| 1147 | ScalarEqualsVisitor visitor(right, options, floating_approximate); |
| 1148 | auto error = VisitScalarInline(left, &visitor); |
| 1149 | DCHECK_OK(error); |
| 1150 | return visitor.result(); |
| 1151 | } |
| 1152 | |
| 1153 | } // namespace |
| 1154 |
no test coverage detected