1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:07:45 +00:00

AK: Provide swap() for HashTable

This commit is contained in:
Dano Perniš 2020-10-17 14:44:59 +02:00 committed by Andreas Kling
parent af20b9424f
commit 7f3f63dd92

View file

@ -133,6 +133,14 @@ public:
return *this;
}
friend void swap(HashTable& a, HashTable& b) noexcept
{
swap(a.m_buckets, b.m_buckets);
swap(a.m_size, b.m_size);
swap(a.m_capacity, b.m_capacity);
swap(a.m_deleted_count, b.m_deleted_count);
}
bool is_empty() const { return !m_size; }
size_t size() const { return m_size; }
size_t capacity() const { return m_capacity; }