chansek
12/07/2018, 9:34 AMdiesieben07
12/07/2018, 9:38 AMlist.slice(0..min(list.lastIndex, 5))
Reinis
12/07/2018, 11:35 AMtake(5)
if you need just firstdiesieben07
12/07/2018, 12:28 PMtake(5)
you are changing the performance characteristics of slice
a lot, since slice(IntRange)
can use subList
, where as slice(Iterable<Int>)
does not.Alan Evans
12/07/2018, 2:55 PMslice(IntRange)
does toList()
so, what's the difference in perf?