So according to <https://blog.jetbrains.com/kotlin...
# random
a
So according to https://blog.jetbrains.com/kotlin/2018/09/kotlin-1-2-70-is-out/ "_Using sequences helps avoid unnecessary temporary allocations overhead_" Why is the non-sequence making temporary allocations? Is this somehow a limitation of
Iterator
?
l
because non sequence execution make loop over collection on each action, in sequence each action call add operation to stack that will be executed with only one loop when terminal operation called
one loop - not in all cases
n
qithout sequnce each
.filter
,
.sortedBy
,
map
call would create a new collection and the next call would run on that
a
Thanks that makes it really clear