https://kotlinlang.org logo
Title
x

xenoterracide

12/27/2018, 6:20 PM
is there a more idiomatic way to write this?
repositories =  modules.map { it to "<mailto:git@bitbucket.org|git@bitbucket.org>:my/${it}.git" } .toMap()
oh nvm someone already answered
t

todd.ginsberg

12/27/2018, 6:36 PM
Kotlin 1.3 has
associateWith
that makes this nicer...
repositories = modules.associateWith { "<mailto:git@bitbucket.org|git@bitbucket.org>:/my$it.git"}
s

Steven McLaughlin

12/27/2018, 6:36 PM
Does that just associate
it
with whatever is in that lambda?
t

todd.ginsberg

12/27/2018, 6:45 PM
Yes
👍 1