Suggestion, but not sure if it breaks when multiple operations are involved: move the last element to the index that is cleared, and reduce the length by one. That way you have minimal modifications, while keeping the list small, and not searching through it with the awkward replace or append function.
Originally posted by @protolambda in #1705
Suggestion, but not sure if it breaks when multiple operations are involved: move the last element to the index that is cleared, and reduce the length by one. That way you have minimal modifications, while keeping the list small, and not searching through it with the awkward replace or append function.
Originally posted by @protolambda in #1705