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

Function MessageEqual

eval/internal/cel_value_equal.cc:145–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145bool MessageEqual(const CelValue::MessageWrapper& m1,
146 const CelValue::MessageWrapper& m2) {
147 const LegacyTypeInfoApis* lhs_type_info = m1.legacy_type_info();
148 const LegacyTypeInfoApis* rhs_type_info = m2.legacy_type_info();
149
150 if (lhs_type_info->GetTypename(m1) != rhs_type_info->GetTypename(m2)) {
151 return false;
152 }
153
154 const LegacyTypeAccessApis* accessor = lhs_type_info->GetAccessApis(m1);
155
156 if (accessor == nullptr) {
157 return false;
158 }
159
160 return accessor->IsEqualTo(m1, m2);
161}
162
163// Generic equality for CEL values of the same type.
164// EqualityProvider is used for equality among members of container types.

Callers 1

CelValueEqualImplFunction · 0.85

Calls 4

legacy_type_infoMethod · 0.80
GetTypenameMethod · 0.45
GetAccessApisMethod · 0.45
IsEqualToMethod · 0.45

Tested by

no test coverage detected