Is there a handy way to `map` only the elements wh...
# announcements
v
Is there a handy way to
map
only the elements where a condition is hold For example to rewrite this code:
list.map { if(it % 2 = 1) it * 2 else it}
Ideally that would work as separating a steam into two streams, and then zipping it together preserving the order (indexing all the elements is ugly and mem consuming)