Leon K
02/24/2020, 2:06 PMlistOf(1, 2, 3).map { it * 2 }
, the compiler takes your { it * 2}
lambda and the things that map does with it (most likely call it inside a for loop or something) and replaces your .map
call with the implementation of map
. This makes .map
have no additional overhead over a for-loop