elect
03/19/2020, 4:05 PM() -> Unit
or a Runnable
(on pure kotlin)?Shawn
03/19/2020, 4:10 PMelect
03/19/2020, 4:11 PMCasey Brooks
03/19/2020, 4:25 PMRunnable
is just an interface, so anytime you pass a Runnable you’re creating a class for that too. They are identical when used, so you should prefer using the lambda syntax for greater clarity and parity with other Kotlin codeelect
03/19/2020, 4:26 PMRunnable
could benefit from some jvm optimizations.. anyway, thanks!Shawn
03/19/2020, 4:27 PMShawn
03/19/2020, 4:29 PMCasey Brooks
03/19/2020, 4:30 PMinline
functions, and thus execute without needing to create that new lambda class. I’m not sure if Runnables
are ever inlined in the same wayShawn
03/19/2020, 4:32 PM