mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +00:00
AK: Allow to clear HashTables/Maps with capacity
This commit is contained in:
parent
5137f96bd6
commit
f76241914c
Notes:
sideshowbarker
2024-07-18 01:17:35 +09:00
Author: https://github.com/Hendiadyoin1
Commit: f76241914c
Pull-request: https://github.com/SerenityOS/serenity/pull/10723
2 changed files with 16 additions and 0 deletions
|
@ -46,6 +46,7 @@ public:
|
|||
[[nodiscard]] size_t size() const { return m_table.size(); }
|
||||
[[nodiscard]] size_t capacity() const { return m_table.capacity(); }
|
||||
void clear() { m_table.clear(); }
|
||||
void clear_with_capacity() { m_table.clear_with_capacity(); }
|
||||
|
||||
HashSetResult set(const K& key, const V& value) { return m_table.set({ key, value }); }
|
||||
HashSetResult set(const K& key, V&& value) { return m_table.set({ key, move(value) }); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue