| 245 | } |
| 246 | |
| 247 | bool 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 | |
| 268 | bool Attribute::operator<(const Attribute& other) const { |
| 269 | if (impl_.get() == other.impl_.get()) { |
nothing calls this directly
no test coverage detected