Completed Coursera: Kotlin for developers course
This commit is contained in:
7
src/Inline.kt
Normal file
7
src/Inline.kt
Normal file
@ -0,0 +1,7 @@
|
||||
fun main() {
|
||||
thisIsInlined { true }
|
||||
}
|
||||
|
||||
// The function is replaced with the contects of the function
|
||||
// No performance overhead
|
||||
inline fun thisIsInlined(predicate: (Int) -> Boolean): Int? = 42.takeIf(predicate)
|
Reference in New Issue
Block a user