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

Method operator==

base/attribute.cc:247–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247bool Attribute::operator==(const Attribute& other) const {
248 // We cannot check pointer equality as a short circuit because we have to
249 // treat all invalid AttributeQualifier as not equal to each other.
250 // TODO(issues/41) we only support Ident-rooted attributes at the moment.
251 if (variable_name() != other.variable_name()) {
252 return false;
253 }
254
255 if (qualifier_path().size() != other.qualifier_path().size()) {
256 return false;
257 }
258
259 for (size_t i = 0; i < qualifier_path().size(); i++) {
260 if (!(qualifier_path()[i] == other.qualifier_path()[i])) {
261 return false;
262 }
263 }
264
265 return true;
266}
267
268bool Attribute::operator<(const Attribute& other) const {
269 if (impl_.get() == other.impl_.get()) {

Callers

nothing calls this directly

Calls 3

variable_nameMethod · 0.80
sizeMethod · 0.45
qualifier_pathMethod · 0.45

Tested by

no test coverage detected