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

Method Equal

common/values/parsed_json_map_value.cc:156–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156absl::Status ParsedJsonMapValue::Equal(
157 const Value& other,
158 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
159 google::protobuf::MessageFactory* absl_nonnull message_factory,
160 google::protobuf::Arena* absl_nonnull arena, Value* absl_nonnull result) const {
161 if (auto other_value = other.AsParsedJsonMap(); other_value) {
162 *result = BoolValue(*this == *other_value);
163 return absl::OkStatus();
164 }
165 if (auto other_value = other.AsParsedMapField(); other_value) {
166 if (value_ == nullptr) {
167 *result = BoolValue(other_value->IsEmpty());
168 return absl::OkStatus();
169 }
170 ABSL_DCHECK(other_value->field_ != nullptr);
171 ABSL_DCHECK(descriptor_pool != nullptr);
172 ABSL_DCHECK(message_factory != nullptr);
173 CEL_ASSIGN_OR_RETURN(
174 auto equal, internal::MessageFieldEquals(
175 *value_, *other_value->message_, other_value->field_,
176 descriptor_pool, message_factory));
177 *result = BoolValue(equal);
178 return absl::OkStatus();
179 }
180 if (auto other_value = other.AsMap(); other_value) {
181 return common_internal::MapValueEqual(MapValue(*this), *other_value,
182 descriptor_pool, message_factory,
183 arena, result);
184 }
185 *result = FalseValue();
186 return absl::OkStatus();
187}
188
189ParsedJsonMapValue ParsedJsonMapValue::Clone(
190 google::protobuf::Arena* absl_nonnull arena) const {

Callers

nothing calls this directly

Calls 8

MapValueEqualFunction · 0.85
FalseValueFunction · 0.85
BoolValueClass · 0.70
MapValueClass · 0.70
AsParsedJsonMapMethod · 0.45
AsParsedMapFieldMethod · 0.45
IsEmptyMethod · 0.45
AsMapMethod · 0.45

Tested by

no test coverage detected