From 2f67f2ba3d2ba151caa5426cd79236f7b7a0fb3d Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 2 Feb 2023 11:02:39 -0500 Subject: [PATCH] AK: Return a constant reference from HashMap's constant get() override We cannot return a mutable reference from a constant function. --- AK/HashMap.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/AK/HashMap.h b/AK/HashMap.h index 979740ac49..ec8d946472 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -154,8 +154,7 @@ public: } template Key> - requires(IsSame>) Optional get(Key const& key) - const + requires(IsSame>) Optional get(Key const& key) const requires(!IsPointer) { auto it = find(key); @@ -165,8 +164,7 @@ public: } template Key> - requires(IsSame>) Optional get(Key const& key) - const + requires(IsSame>) Optional get(Key const& key) const requires(IsPointer) { auto it = find(key);