Skip to content

Commit 4a31936

Browse files
committed
Merge pull request godotengine#104693 from mihe/local-vector-move
Optimize `LocalVector::push_back` for non-trivial objects
2 parents fd8c010 + 5c5b984 commit 4a31936

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/templates/local_vector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class LocalVector {
6464
}
6565

6666
if constexpr (!std::is_trivially_constructible_v<T> && !force_trivial) {
67-
memnew_placement(&data[count++], T(p_elem));
67+
memnew_placement(&data[count++], T(std::move(p_elem)));
6868
} else {
6969
data[count++] = std::move(p_elem);
7070
}

0 commit comments

Comments
 (0)