| 79 | } |
| 80 | |
| 81 | absl::Status IntValue::Equal( |
| 82 | const Value& other, |
| 83 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 84 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 85 | google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const { |
| 86 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 87 | ABSL_DCHECK(message_factory != nullptr); |
| 88 | ABSL_DCHECK(arena != nullptr); |
| 89 | ABSL_DCHECK(result != nullptr); |
| 90 | |
| 91 | if (auto other_value = other.AsInt(); other_value.has_value()) { |
| 92 | *result = BoolValue{NativeValue() == other_value->NativeValue()}; |
| 93 | return absl::OkStatus(); |
| 94 | } |
| 95 | if (auto other_value = other.AsDouble(); other_value.has_value()) { |
| 96 | *result = |
| 97 | BoolValue{internal::Number::FromInt64(NativeValue()) == |
| 98 | internal::Number::FromDouble(other_value->NativeValue())}; |
| 99 | return absl::OkStatus(); |
| 100 | } |
| 101 | if (auto other_value = other.AsUint(); other_value.has_value()) { |
| 102 | *result = |
| 103 | BoolValue{internal::Number::FromInt64(NativeValue()) == |
| 104 | internal::Number::FromUint64(other_value->NativeValue())}; |
| 105 | return absl::OkStatus(); |
| 106 | } |
| 107 | *result = FalseValue(); |
| 108 | return absl::OkStatus(); |
| 109 | } |
| 110 | |
| 111 | } // namespace cel |