From 80e950ac32d3ced46f56b15fc4340fbf4729a0f1 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Fri, 20 Sep 2024 00:03:41 +0200 Subject: [PATCH] [util] Fix small_vector move ... again. We can only move over the ptr if the other small_vector has MORE than N elements, otherwise it will still use the local array. --- src/util/util_small_vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/util_small_vector.h b/src/util/util_small_vector.h index 27aa754b9..93b84a491 100644 --- a/src/util/util_small_vector.h +++ b/src/util/util_small_vector.h @@ -33,7 +33,7 @@ namespace dxvk { }; small_vector(small_vector&& other) { - if (other.m_size < N) { + if (other.m_size <= N) { for (size_t i = 0; i < other.m_size; i++) { new (&u.m_data[i]) T(std::move(*other.ptr(i))); } @@ -54,7 +54,7 @@ namespace dxvk { if (m_capacity > N) delete[] u.m_ptr; - if (other.m_size < N) { + if (other.m_size <= N) { m_capacity = N; for (size_t i = 0; i < other.m_size; i++) { new (&u.m_data[i]) T(std::move(*other.ptr(i)));