https://kotlinlang.org logo
Title
u

ursus

09/27/2019, 2:42 AM
but it should be maybe more efficient, i.e. just trim the underlying array
n

Nate

09/27/2019, 2:46 AM
Not sure, but I think
subList
could be the closest to what you want https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/sub-list.html
Returns a view of the portion of this list between the specified fromIndex (inclusive) and toIndex (exclusive). The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.
How that’s implemented though, I don’t know.
u

ursus

09/27/2019, 2:49 AM
AbstractList line 34
create a new object with reference to the same list, and throws on out of bounds, specificed in the sublist method
thanks