robstoll
06/23/2020, 7:33 PMidentity
lambda out of the box?araqnid
06/23/2020, 7:35 PM{ it }
is shorter đaraqnid
06/23/2020, 7:36 PMMatteo Mirk
06/24/2020, 7:43 AMidentity()
is a handy replacement for its lengthy Function type and lambda declarations.robstoll
06/24/2020, 8:18 AMgildor
06/24/2020, 8:24 AMgildor
06/24/2020, 8:25 AMMatteo Mirk
06/24/2020, 8:28 AMidentity
top level function for clarity. If youâre concerned about memory allocation, rest assured that a lambda expression that doesnât close over parent scope is reused as a singleton: https://stackoverflow.com/questions/42271208/kotlin-safe-lambdas-no-memory-leak/42275638#42275638robstoll
06/24/2020, 8:29 AM{ it }
. I guess the first is truerobstoll
06/24/2020, 8:29 AMMatteo Mirk
06/24/2020, 8:32 AMgildor
06/24/2020, 8:32 AMre-used for this single place or over all places where you haveÂIt reused only in a single class file{ it }
Matteo Mirk
06/24/2020, 8:34 AMgildor
06/24/2020, 8:39 AMgildor
06/24/2020, 8:40 AMMatteo Mirk
06/24/2020, 8:40 AMgildor
06/24/2020, 8:41 AMgildor
06/24/2020, 8:42 AMgildor
06/24/2020, 8:42 AMgildor
06/24/2020, 8:43 AMMatteo Mirk
06/24/2020, 8:44 AMgildor
06/24/2020, 8:45 AMgildor
06/24/2020, 8:47 AMrobstoll
06/24/2020, 8:48 AM