Jan
04/06/2022, 3:31 PM@PublishedApi
internal var onFinish = {}
inline fun onFinish(action: () -> Unit) {
onFinish = action
}
Sam
04/06/2022, 3:34 PMThemodifier affects both the function itself and the lambdas passed to it: all of those will be inlined into the call site.inline
https://kotlinlang.org/docs/inline-functions.html
Sam
04/06/2022, 3:36 PMephemient
04/06/2022, 3:36 PMnoinline
keyword, as documented thereephemient
04/06/2022, 3:37 PMinline fun onFinish(crossinline action: () -> Unit) {
onFinish = { action() }
}
but that is definitely less clear than noinline
Jan
04/06/2022, 3:48 PM