currently, List.dropFirst is the same as List.dropAt 0, which clones the entire list except the first element into a new list.
however, if we specifically know we're dropping the first element, we have the option of returning a seamless slice of the original list—meaning that instead of cloning the entire list, we would bump its refcount by 1.
should we do that? thoughts?
Already dealt with
Look at the zig built-in for List.sublist
That said, it is a tiny bit less optimal cause it calls the generic function which then runs an if to check if it is dropping the beginning of the list and if it is unique or not. So if List.sublist isnt inlined, it is a bit extra work.
That said, I'm not sure what option we take if the list is unique. I think we shift in place, but we may make a seamless slice. That is up to us if we want to change the default.
Last updated: Jun 16 2026 at 16:19 UTC