Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created October 12, 2020 13:18
Show Gist options
  • Save ch8n/a72ffc2633c27c024a065b1d36516c98 to your computer and use it in GitHub Desktop.
Save ch8n/a72ffc2633c27c024a065b1d36516c98 to your computer and use it in GitHub Desktop.
fun <K, V> mutableMapOf(vararg pairs: Pair<K, V>): MutableMap<K, V>
= LinkedHashMap<K, V>(mapCapacity(pairs.size))
.apply { putAll(pairs) }
// resolved with LinkedHashMap only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment