Amanieu opened PR #2714 from more_entitylist
to main
:
This PR contains several improvements to EntityList:
swap_remove
had poor codegen because it ends up callingremove
and doing a bunch of redundant work. I factored out the code to remove the last element of a list intoremove_last
, which is used by bothremove
andswap_remove
.- Added
deep_clone
which copies all elements to a new list. This is difficult to implement efficiently otherwise since it requires mutable access to the list pool for one lists while reading from another list.- Added
truncate
which efficiently shortens a list without needing to remove elements individually.
cfallin submitted PR Review.
cfallin merged PR #2714.
Last updated: Dec 23 2024 at 13:07 UTC