summaryrefslogtreecommitdiff
path: root/AK/HashTable.h
diff options
context:
space:
mode:
Diffstat (limited to 'AK/HashTable.h')
-rw-r--r--AK/HashTable.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/HashTable.h b/AK/HashTable.h
index 7a02060141..8a4b5f847d 100644
--- a/AK/HashTable.h
+++ b/AK/HashTable.h
@@ -49,6 +49,12 @@ public:
int size() const { return m_size; }
int capacity() const { return m_capacity; }
+ void ensure_capacity(int capacity)
+ {
+ ASSERT(capacity >= size());
+ rehash(capacity);
+ }
+
void set(const T&);
void set(T&&);
bool contains(const T&) const;