|
29 | 29 |
|
30 | 30 | #include "absl/base/attributes.h" |
31 | 31 | #include "absl/base/nullability.h" |
32 | | -#include "absl/hash/hash.h" |
33 | 32 | #include "absl/log/absl_check.h" |
34 | 33 | #include "absl/meta/type_traits.h" |
35 | 34 | #include "absl/status/statusor.h" |
@@ -160,16 +159,6 @@ class EnumTypeInterface : public TypeInterface, |
160 | 159 | private: |
161 | 160 | friend class EnumType; |
162 | 161 | friend class EnumTypeView; |
163 | | - friend bool operator==(const EnumType& lhs, const EnumType& rhs); |
164 | | - template <typename H> |
165 | | - friend H AbslHashValue(H state, const EnumType& type); |
166 | | - friend bool operator==(EnumTypeView lhs, EnumTypeView rhs); |
167 | | - template <typename H> |
168 | | - friend H AbslHashValue(H state, EnumTypeView type); |
169 | | - |
170 | | - virtual bool Equals(const EnumTypeInterface& other) const = 0; |
171 | | - |
172 | | - virtual void HashValue(absl::HashState state) const = 0; |
173 | 162 |
|
174 | 163 | virtual absl::StatusOr<absl::optional<EnumTypeValueId>> FindIdByName( |
175 | 164 | absl::string_view name) const ABSL_ATTRIBUTE_LIFETIME_BOUND = 0; |
@@ -248,14 +237,12 @@ class EnumType { |
248 | 237 | } |
249 | 238 |
|
250 | 239 | friend bool operator==(const EnumType& lhs, const EnumType& rhs) { |
251 | | - return lhs.name() == rhs.name() && lhs.interface_->Equals(*rhs.interface_); |
| 240 | + return lhs.name() == rhs.name(); |
252 | 241 | } |
253 | 242 |
|
254 | 243 | template <typename H> |
255 | 244 | friend H AbslHashValue(H state, const EnumType& type) { |
256 | | - state = H::combine(std::move(state), type.kind(), type.name()); |
257 | | - type.interface_->HashValue(absl::HashState::Create(&state)); |
258 | | - return std::move(state); |
| 245 | + return H::combine(std::move(state), type.kind(), type.name()); |
259 | 246 | } |
260 | 247 |
|
261 | 248 | private: |
@@ -453,14 +440,12 @@ class EnumTypeView { |
453 | 440 | } |
454 | 441 |
|
455 | 442 | friend bool operator==(EnumTypeView lhs, EnumTypeView rhs) { |
456 | | - return lhs.name() == rhs.name() && lhs.interface_->Equals(*rhs.interface_); |
| 443 | + return lhs.name() == rhs.name(); |
457 | 444 | } |
458 | 445 |
|
459 | 446 | template <typename H> |
460 | 447 | friend H AbslHashValue(H state, EnumTypeView type) { |
461 | | - state = H::combine(std::move(state), type.kind(), type.name()); |
462 | | - type.interface_->HashValue(absl::HashState::Create(&state)); |
463 | | - return std::move(state); |
| 448 | + return H::combine(std::move(state), type.kind(), type.name()); |
464 | 449 | } |
465 | 450 |
|
466 | 451 | private: |
|
0 commit comments