mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Reorder access in FixedArray so that m_size comes before m_elements
This commit is contained in:
parent
3c05261611
commit
18a2685c6a
Notes:
sideshowbarker
2024-07-17 21:24:27 +09:00
Author: https://github.com/creator1creeper1 Commit: https://github.com/SerenityOS/serenity/commit/18a2685c6a4
1 changed files with 2 additions and 2 deletions
|
@ -79,8 +79,8 @@ public:
|
|||
for (size_t i = 0; i < m_size; ++i)
|
||||
m_elements[i].~T();
|
||||
kfree_sized(m_elements, sizeof(T) * m_size);
|
||||
m_elements = nullptr;
|
||||
m_size = 0;
|
||||
m_elements = nullptr;
|
||||
}
|
||||
|
||||
size_t size() const { return m_size; }
|
||||
|
@ -110,8 +110,8 @@ public:
|
|||
|
||||
void swap(FixedArray<T>& other)
|
||||
{
|
||||
::swap(m_elements, other.m_elements);
|
||||
::swap(m_size, other.m_size);
|
||||
::swap(m_elements, other.m_elements);
|
||||
}
|
||||
|
||||
using ConstIterator = SimpleIterator<FixedArray const, T const>;
|
||||
|
|
Loading…
Reference in a new issue