1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[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.
This commit is contained in:
Robin Kertels 2024-09-20 00:03:41 +02:00 committed by Philip Rebohle
parent 2f9ce66879
commit 80e950ac32

View File

@ -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)));