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

Method Equal

common/values/parsed_json_list_value.cc:153–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

ContainsMethod · 0.45

Calls 7

ListValueEqualFunction · 0.85
BoolValueClass · 0.70
ListValueClass · 0.70
AsParsedJsonListMethod · 0.45
AsParsedRepeatedFieldMethod · 0.45
IsEmptyMethod · 0.45
AsListMethod · 0.45

Tested by

no test coverage detected