Simplify Memory::memnew_arr_placement to always initialize memory, to force callers to make the decision of whether to initialize.

This commit is contained in:
Lukas Tenbrink
2025-05-19 20:52:08 +02:00
parent 7a0ab9d561
commit 4371aa864d
5 changed files with 16 additions and 16 deletions

View File

@ -107,7 +107,7 @@ public:
constexpr Error resize_initialized(uint32_t p_size) {
if (p_size > _size) {
ERR_FAIL_COND_V(p_size > CAPACITY, ERR_OUT_OF_MEMORY);
memnew_arr_placement<true>(ptr() + _size, p_size - _size);
memnew_arr_placement(ptr() + _size, p_size - _size);
} else if (p_size < _size) {
if constexpr (!std::is_trivially_destructible_v<T>) {
for (uint32_t i = p_size; i < _size; i++) {