Add unordered array element remove #11419
timothyqiu
started this conversation in
Engine Core
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
remove_at(index)
shifts every element afterindex
. This has a significant performance cost if the array contains many elements.For order-insensitive usages (e.g. using the array as a set), removing an element can be implemented as copying the last element to
index
. This is cheaper.So I suggest adding something like
remove_at_unordered(index)
to array types.Beta Was this translation helpful? Give feedback.
All reactions