Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created October 12, 2020 12:52
Show Gist options
  • Save ch8n/08818e0fb1ea6af24c70b6354d2c6b31 to your computer and use it in GitHub Desktop.
Save ch8n/08818e0fb1ea6af24c70b6354d2c6b31 to your computer and use it in GitHub Desktop.
no direct conversion
// you need to first convert to map
mutableListOf<Pair<String,Int>>(pair,updatedPair).toMap()
// then you have access to mutableMap extension
mutableListOf<Pair<String,Int>>(pair,updatedPair).toMap().toMutableMap()
//signature
fun <K, V> Map<out K, V>.toMutableMap(): MutableMap<K, V>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment