Last active
November 27, 2019 19:02
-
-
Save shahsurajk/168b1d735b55af8d09332a8ea70cf606 to your computer and use it in GitHub Desktop.
Non inlined lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun testLambdas(index: Int, myLambda: (index: Int) -> Unit){ | |
myLambda.invoke(index+1) | |
} | |
fun myBigLoop(){ | |
(0 .. 50).forEach { | |
// our lambda being consumed here. | |
testLambdas(it) { lambdaValue-> | |
println(lambdaValue) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment