Skip to content

Instantly share code, notes, and snippets.

@sfeatherstone
Created March 5, 2018 16:21
Show Gist options
  • Save sfeatherstone/92a05a310315aa397401d1525ffbcb40 to your computer and use it in GitHub Desktop.
Save sfeatherstone/92a05a310315aa397401d1525ffbcb40 to your computer and use it in GitHub Desktop.
//Copy using the lamda in the constructor
inline fun <reified T> catTwoArrays3(array1 :Array<T>, array2 :Array<T>) : Array<T> {
return Array<T>(array1.size + array2.size,
{ if (it<array1.size) array1[it] else array2[it-array1.size]})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment