Skip to content

Instantly share code, notes, and snippets.

@Nublo
Created October 7, 2018 14:46
Show Gist options
  • Save Nublo/1f047f4a60a3ba78d03cf0a952257d9d to your computer and use it in GitHub Desktop.
Save Nublo/1f047f4a60a3ba78d03cf0a952257d9d to your computer and use it in GitHub Desktop.
val <T> List<T>.size: Int
get() = when (this.isEmpty()) {
true -> 0
false -> 1 + this.tail.size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment