mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-17 13:17:33 +00:00
AK: Return a constant reference from HashMap's constant get() override
We cannot return a mutable reference from a constant function.
This commit is contained in:
committed by
Linus Groh
parent
ef7f343e95
commit
2f67f2ba3d
@@ -154,8 +154,7 @@ public:
|
||||
}
|
||||
|
||||
template<Concepts::HashCompatible<K> Key>
|
||||
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::PeekType> get(Key const& key)
|
||||
const
|
||||
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::ConstPeekType> get(Key const& key) const
|
||||
requires(!IsPointer<typename ValueTraits::PeekType>)
|
||||
{
|
||||
auto it = find(key);
|
||||
@@ -165,8 +164,7 @@ public:
|
||||
}
|
||||
|
||||
template<Concepts::HashCompatible<K> Key>
|
||||
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::ConstPeekType> get(Key const& key)
|
||||
const
|
||||
requires(IsSame<KeyTraits, Traits<K>>) Optional<typename ValueTraits::ConstPeekType> get(Key const& key) const
|
||||
requires(IsPointer<typename ValueTraits::PeekType>)
|
||||
{
|
||||
auto it = find(key);
|
||||
|
||||
Reference in New Issue
Block a user