Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Last active December 11, 2018 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/79e075ec833d72c7485577a24cc0d930 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/79e075ec833d72c7485577a24cc0d930 to your computer and use it in GitHub Desktop.
fun notInlinedFilter(list: List<Int>, predicate: (Int) -> Boolean): List<Int> {
return list.filter(predicate)
}
fun notInlinedTest() {
val list = listOf(1, 2, 3)
val newList = notInlinedFilter(list) { it < 2 }
println(newList)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment