Ben Edwards
08/23/2022, 2:30 PMJoffrey
08/23/2022, 2:32 PMArrayList
, you should stick to the more general mutableListOf
and let Kotlin decide, as you said, KMM or not.
Note that ArrayList
is defined in common Kotlin code, so it would be available in KMM too anyway, but that's not really the point of using mutableListOf
- it's more about generalitymkrussel
08/23/2022, 2:32 PMephemient
08/23/2022, 2:34 PMKlitos Kyriacou
08/23/2022, 2:37 PMArrayList
if I know the initial capacity.Joffrey
08/23/2022, 2:40 PMmap
operation or other functional operators, so I still don't need ArrayList
. I haven't needed it directly for quite some time to be frank.
That said, I also haven't needed mutableListOf
much either. buildList { ... }
usually covers everything that cannot be more efficiently expressed by functional operatorsBen Edwards
08/23/2022, 2:40 PMKlitos Kyriacou
08/23/2022, 2:49 PMbuildList
also allows you to add an initial capacity too.