mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:24:57 +00:00
AK: Reorder access in FixedArray so that m_size comes before m_elements
This commit is contained in:
parent
3c05261611
commit
18a2685c6a
1 changed files with 2 additions and 2 deletions
|
@ -79,8 +79,8 @@ public:
|
||||||
for (size_t i = 0; i < m_size; ++i)
|
for (size_t i = 0; i < m_size; ++i)
|
||||||
m_elements[i].~T();
|
m_elements[i].~T();
|
||||||
kfree_sized(m_elements, sizeof(T) * m_size);
|
kfree_sized(m_elements, sizeof(T) * m_size);
|
||||||
m_elements = nullptr;
|
|
||||||
m_size = 0;
|
m_size = 0;
|
||||||
|
m_elements = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size() const { return m_size; }
|
size_t size() const { return m_size; }
|
||||||
|
@ -110,8 +110,8 @@ public:
|
||||||
|
|
||||||
void swap(FixedArray<T>& other)
|
void swap(FixedArray<T>& other)
|
||||||
{
|
{
|
||||||
::swap(m_elements, other.m_elements);
|
|
||||||
::swap(m_size, other.m_size);
|
::swap(m_size, other.m_size);
|
||||||
|
::swap(m_elements, other.m_elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
using ConstIterator = SimpleIterator<FixedArray const, T const>;
|
using ConstIterator = SimpleIterator<FixedArray const, T const>;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue