toSingletonMap implementation using MutableMap

This commit is contained in:
Pavel Punegov
2018-06-09 17:25:23 +03:00
committed by Pavel Punegov
parent d78d14cd00
commit 6a453c8bb7
@@ -21,4 +21,4 @@ internal inline actual fun <K, V> Map<K, V>.toSingletonMapOrSelf(): Map<K, V> =
// creates a singleton copy of map
internal actual fun <K, V> Map<out K, V>.toSingletonMap(): Map<K, V>
= this.toMutableMap() // TODO
= with(entries.iterator().next()) { mutableMapOf(key to value) }