Optimize LocalVector::push_back for non-trivial objects

This commit is contained in:
Mikael Hermansson
2025-03-27 14:22:30 +01:00
parent 594d64ec24
commit 5c5b9847da

View File

@ -64,7 +64,7 @@ public:
} }
if constexpr (!std::is_trivially_constructible_v<T> && !force_trivial) { if constexpr (!std::is_trivially_constructible_v<T> && !force_trivial) {
memnew_placement(&data[count++], T(p_elem)); memnew_placement(&data[count++], T(std::move(p_elem)));
} else { } else {
data[count++] = std::move(p_elem); data[count++] = std::move(p_elem);
} }