diff --git a/AK/HashMap.h b/AK/HashMap.h index 22abc069529..c4c72bbcfdc 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -243,6 +243,12 @@ public: return {}; } + V take_first() + requires(IsOrdered) + { + return take(begin()->key).release_value(); + } + V& ensure(K const& key) { auto it = find(key);