Skip to content

Instantly share code, notes, and snippets.

@aembleton
Created April 29, 2016 15:21
Show Gist options
  • Save aembleton/2ad2a09efb69d9dca123cebd4b72a9f9 to your computer and use it in GitHub Desktop.
Save aembleton/2ad2a09efb69d9dca123cebd4b72a9f9 to your computer and use it in GitHub Desktop.
public inline fun <T,R> Iterator<T>.map(transform: (T) -> R) : List<R> {
val list = ArrayList<R>()
this.forEach { list.add(transform(it)) }
return list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment