https://kotlinlang.org logo
h

Hullaballoonatic

10/27/2019, 8:42 PM
fun <K, V> MutableMap<K, V>.putAll(vararg pairs: Pair<K, V>): Unit
kinda strange it's not in the stdlib already...?
d

Dominaezzz

10/27/2019, 8:54 PM
Yeah ikr, I've asked for this somewhere.
You can do
pairs.associateTo(this) { it }
.
h

Hullaballoonatic

10/28/2019, 6:16 PM
oh, thanks
k

karelpeeters

10/29/2019, 2:28 PM
Am I missing something? It does exist,
+=
works as well: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/put-all.html
d

Dominaezzz

10/29/2019, 2:41 PM
Oh wow. It's not vararg though. 😛
h

Hullaballoonatic

10/29/2019, 7:07 PM
@karelpeeters yeah, i'm aware of that. I'm specifically asking for a vararg variation
k

karelpeeters

10/29/2019, 7:08 PM
Oh okay, just making sure simple smile
h

Hullaballoonatic

10/29/2019, 7:09 PM
although, this post should have probably been made in #stdlib instead...