From 3404cd0752ebcad7782ca7863fda0985f478e0a0 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Mon, 1 Jan 2024 13:05:54 -0500 Subject: DynArray resize should destruct --- src/dynamic-array.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dynamic-array.hpp') diff --git a/src/dynamic-array.hpp b/src/dynamic-array.hpp index 307983d..d35e5e2 100644 --- a/src/dynamic-array.hpp +++ b/src/dynamic-array.hpp @@ -208,7 +208,7 @@ template inline void DynArray::Resize(int64_t count) { int64_t beforeCount = this->elementCount; if IS_DESTRUCTIBLE(T) { if (beforeCount > count) { - for (long i = count; i > beforeCount; --i) { + for (int64_t i = beforeCount; i > count; --i) { reinterpret_cast(this->ptr + (i * sizeof(T)))->~T(); } } -- cgit v1.2.3