Created
December 11, 2018 14:07
-
-
Save sajjadyousefnia/857584ce28ce012a045b9c519d2d97c6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
inline fun inlinedFilter(list : List<Int>, predicate : (Int) -> Boolean) : List<Int>{ | |
return list.filter(predicate) | |
} | |
fun lambdaInCallSiteTest() { | |
val list = listOf(1,2,3) | |
val newList = inlinedFilter(list) {it < 2} | |
println(newList) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment