mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:47:35 +00:00
AK: Annotate HashTable functions as [[nodiscard]]
This commit is contained in:
parent
15b94ec1fd
commit
0593fa4dcb
1 changed files with 5 additions and 5 deletions
|
@ -142,9 +142,9 @@ public:
|
|||
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; }
|
||||
[[nodiscard]] bool is_empty() const { return !m_size; }
|
||||
[[nodiscard]] size_t size() const { return m_size; }
|
||||
[[nodiscard]] size_t capacity() const { return m_capacity; }
|
||||
|
||||
template<typename U, size_t N>
|
||||
void set_from(U (&from_array)[N])
|
||||
|
@ -352,8 +352,8 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
size_t used_bucket_count() const { return m_size + m_deleted_count; }
|
||||
bool should_grow() const { return ((used_bucket_count() + 1) * 100) >= (m_capacity * load_factor_in_percent); }
|
||||
[[nodiscard]] size_t used_bucket_count() const { return m_size + m_deleted_count; }
|
||||
[[nodiscard]] bool should_grow() const { return ((used_bucket_count() + 1) * 100) >= (m_capacity * load_factor_in_percent); }
|
||||
|
||||
Bucket* m_buckets { nullptr };
|
||||
size_t m_size { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue