mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
AK: Add OrderedHashMap::take_first()
This is just a convenience shortcut for *take(begin()->key).
This commit is contained in:
parent
0042bbb68d
commit
08ec58f347
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user