AK: Provide swap() for HashTable
This commit is contained in:
parent
af20b9424f
commit
7f3f63dd92
Notes:
sideshowbarker
2024-07-19 01:51:41 +09:00
Author: https://github.com/danopernis 🔰 Commit: https://github.com/SerenityOS/serenity/commit/7f3f63dd923 Pull-request: https://github.com/SerenityOS/serenity/pull/3788
1 changed files with 8 additions and 0 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Reference in a new issue