MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Equal

Method Equal

common/values/bytes_value.cc:103–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103absl::Status BytesValue::Equal(
104 const Value& other,
105 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
106 google::protobuf::MessageFactory* absl_nonnull message_factory,
107 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
108 ABSL_DCHECK(descriptor_pool != nullptr);
109 ABSL_DCHECK(message_factory != nullptr);
110 ABSL_DCHECK(arena != nullptr);
111 ABSL_DCHECK(result != nullptr);
112
113 if (auto other_value = other.AsBytes(); other_value.has_value()) {
114 *result = NativeValue([other_value](const auto& value) -> BoolValue {
115 return other_value->NativeValue(
116 [&value](const auto& other_value) -> BoolValue {
117 return BoolValue{value == other_value};
118 });
119 });
120 return absl::OkStatus();
121 }
122 *result = FalseValue();
123 return absl::OkStatus();
124}
125
126BytesValue BytesValue::Clone(google::protobuf::Arena* absl_nonnull arena) const {
127 return BytesValue(value_.Clone(arena));

Callers

nothing calls this directly

Calls 5

FalseValueFunction · 0.85
NativeValueFunction · 0.70
AsBytesMethod · 0.45
has_valueMethod · 0.45
NativeValueMethod · 0.45

Tested by

no test coverage detected