Skip to content

Instantly share code, notes, and snippets.

@Pozo
Created August 20, 2017 18:36
Show Gist options
  • Save Pozo/bdffe8987e0fac5a19ea13c2d3ed86f2 to your computer and use it in GitHub Desktop.
Save Pozo/bdffe8987e0fac5a19ea13c2d3ed86f2 to your computer and use it in GitHub Desktop.
fun lazyMap() {
val map = mutableMapOf("aaa" to mutableListOf(32))
map.putIfAbsent("aaa", mutableListOf(2))?.add(2)
println(map)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment