| 86 | } |
| 87 | |
| 88 | absl::Status OptionalValueEqual( |
| 89 | const OpaqueValueDispatcher* absl_nonnull dispatcher, |
| 90 | OpaqueValueContent content, const OpaqueValue& other, |
| 91 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 92 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 93 | google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) { |
| 94 | ABSL_DCHECK(descriptor_pool != nullptr); |
| 95 | ABSL_DCHECK(message_factory != nullptr); |
| 96 | ABSL_DCHECK(arena != nullptr); |
| 97 | ABSL_DCHECK(result != nullptr); |
| 98 | if (auto other_optional = other.AsOptional(); other_optional) { |
| 99 | const bool lhs_has_value = |
| 100 | static_cast<const OptionalValueDispatcher*>(dispatcher) |
| 101 | ->has_value(static_cast<const OptionalValueDispatcher*>(dispatcher), |
| 102 | content); |
| 103 | const bool rhs_has_value = other_optional->HasValue(); |
| 104 | if (lhs_has_value != rhs_has_value) { |
| 105 | *result = FalseValue(); |
| 106 | return absl::OkStatus(); |
| 107 | } |
| 108 | if (!lhs_has_value) { |
| 109 | *result = TrueValue(); |
| 110 | return absl::OkStatus(); |
| 111 | } |
| 112 | Value lhs_value; |
| 113 | Value rhs_value; |
| 114 | static_cast<const OptionalValueDispatcher*>(dispatcher) |
| 115 | ->value(static_cast<const OptionalValueDispatcher*>(dispatcher), |
| 116 | content, &lhs_value); |
| 117 | other_optional->Value(&rhs_value); |
| 118 | return lhs_value.Equal(rhs_value, descriptor_pool, message_factory, arena, |
| 119 | result); |
| 120 | } |
| 121 | *result = FalseValue(); |
| 122 | return absl::OkStatus(); |
| 123 | } |
| 124 | |
| 125 | ABSL_CONST_INIT const OptionalValueDispatcher |
| 126 | empty_optional_value_dispatcher = { |
nothing calls this directly
no test coverage detected