mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
AK: Always initialize vector capacity to inline_capacity
This ensures constructors that take a span or an initializer_list don't allocate when there's already enough inline storage. (Previously these constructors always allocated)
This commit is contained in:
parent
e1b15b9a44
commit
c0b7ff3c4c
1 changed files with 1 additions and 2 deletions
|
@ -55,7 +55,6 @@ private:
|
||||||
public:
|
public:
|
||||||
using ValueType = T;
|
using ValueType = T;
|
||||||
Vector()
|
Vector()
|
||||||
: m_capacity(inline_capacity)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +832,7 @@ private:
|
||||||
StorageType& raw_at(size_t index) { return *slot(index); }
|
StorageType& raw_at(size_t index) { return *slot(index); }
|
||||||
|
|
||||||
size_t m_size { 0 };
|
size_t m_size { 0 };
|
||||||
size_t m_capacity { 0 };
|
size_t m_capacity { inline_capacity };
|
||||||
|
|
||||||
static constexpr size_t storage_size()
|
static constexpr size_t storage_size()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue