Created
October 7, 2018 14:53
-
-
Save Nublo/12a1a5db395d5e7ff4ae285e44952096 to your computer and use it in GitHub Desktop.
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
operator fun <T> List<T>.plus(xs: List<T>): List<T> = when (xs.size) { | |
0 -> ArrayList(this) | |
else -> (this + xs.head) + xs.tail | |
} | |
operator fun <T> T.plus(xs: List<T>): List<T> = listOf(this) + xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment