summaryrefslogtreecommitdiff
path: root/AK/HashMap.h
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-09-20 23:43:52 +0200
committerAndreas Kling <kling@serenityos.org>2021-11-11 09:19:17 +0100
commitf76241914c8a2b860c1e6fd3d7172aa22e5b0d9d (patch)
tree94de3c373dd5a1e63c3da1e2a64a4c8dbc9ef73b /AK/HashMap.h
parent5137f96bd64783d816f4fe9477fcf7f278d32488 (diff)
downloadserenity-f76241914c8a2b860c1e6fd3d7172aa22e5b0d9d.zip
AK: Allow to clear HashTables/Maps with capacity
Diffstat (limited to 'AK/HashMap.h')
-rw-r--r--AK/HashMap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/AK/HashMap.h b/AK/HashMap.h
index 733a7057cc..5303bdf32d 100644
--- a/AK/HashMap.h
+++ b/AK/HashMap.h
@@ -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) }); }