pub fn orderedRemove(self: *Self, i: usize) T self: *Selfi: usize308
309
310
311
312 pub fn orderedRemove(self: *Self, i: usize) T {
const old_item = self.items[i];
self.replaceRangeAssumeCapacity(i, 1, &.{});
return old_item;
}
Remove the element at index
i, shift elements after indexiforward, and return the removed element. Invalidates element pointers to end of list. This operation is O(N). This preserves item order. UseswapRemoveif order preservation is not important. Asserts that the index is in bounds. Asserts that the list is not empty.