Thread
#stdlib
    orangy

    orangy

    5 years ago
    Beware that
    subList
    is a view. If original list changes, then sublist also changes.
    m

    mg6maciej

    5 years ago
    Yes, I'm aware of the differences between it and take/drop. My model is truly immutable, always returning a copy of data class with all vals, that's why I wanted to try your immutable collections out.
    There could also be a problem of keeping the whole list after using
    subList
    .
    orangy

    orangy

    5 years ago
    Right. There are many reasons why Kotlin defaults to "create a snapshot” behaviour 🙂