AK: Vector::resize() should initialize new slots for primitive types

We call placement new for the newly added slots. However, we should
also specify an initializer so primitive data types like u64 are
initialized appropriately.
This commit is contained in:
Gunnar Beutner 2021-05-13 14:28:32 +02:00 committed by Andreas Kling
parent 339b368308
commit a11a1cd4d6
Notes: sideshowbarker 2024-07-18 18:12:05 +09:00

View File

@ -619,7 +619,7 @@ public:
return false;
for (size_t i = size(); i < new_size; ++i)
new (slot(i)) T;
new (slot(i)) T {};
m_size = new_size;
return true;
}