diff options
Diffstat (limited to 'AK/HashMap.h')
-rw-r--r-- | AK/HashMap.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/AK/HashMap.h b/AK/HashMap.h index 87d66c2523..4590f932d0 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -22,8 +22,8 @@ private: }; struct EntryTraits { - static unsigned hash(const Entry& entry) { return KeyTraits::hash(entry.key); } - static bool equals(const Entry& a, const Entry& b) { return KeyTraits::equals(a.key, b.key); } + static unsigned hash(Entry const& entry) { return KeyTraits::hash(entry.key); } + static bool equals(Entry const& a, Entry const& b) { return KeyTraits::equals(a.key, b.key); } }; public: @@ -152,7 +152,8 @@ public: } template<Concepts::HashCompatible<K> Key> - requires(IsSame<KeyTraits, Traits<K>>) Optional<typename Traits<V>::PeekType> get(const Key& key) const requires(!IsPointer<typename Traits<V>::PeekType>) + requires(IsSame<KeyTraits, Traits<K>>) Optional<typename Traits<V>::PeekType> get(Key const& key) + const requires(!IsPointer<typename Traits<V>::PeekType>) { auto it = find(key); if (it == end()) @@ -161,7 +162,8 @@ public: } template<Concepts::HashCompatible<K> Key> - requires(IsSame<KeyTraits, Traits<K>>) Optional<typename Traits<V>::ConstPeekType> get(const Key& key) const requires(IsPointer<typename Traits<V>::PeekType>) + requires(IsSame<KeyTraits, Traits<K>>) Optional<typename Traits<V>::ConstPeekType> get(Key const& key) + const requires(IsPointer<typename Traits<V>::PeekType>) { auto it = find(key); if (it == end()) @@ -170,7 +172,8 @@ public: } template<Concepts::HashCompatible<K> Key> - requires(IsSame<KeyTraits, Traits<K>>) Optional<typename Traits<V>::PeekType> get(const Key& key) requires(!IsConst<typename Traits<V>::PeekType>) + requires(IsSame<KeyTraits, Traits<K>>) Optional<typename Traits<V>::PeekType> get(Key const& key) + requires(!IsConst<typename Traits<V>::PeekType>) { auto it = find(key); if (it == end()) |