Skip to content

Instantly share code, notes, and snippets.

@ch8n
Created October 12, 2020 12:28
Show Gist options
  • Save ch8n/69d60474085e290e50120f93bed1bef8 to your computer and use it in GitHub Desktop.
Save ch8n/69d60474085e290e50120f93bed1bef8 to your computer and use it in GitHub Desktop.
entries to Pair
// enteries to map example
val entries:Set<Entry<String, Int>> = setOf(entry)
val map = entries.map { entry -> entry.toPair() }.toMap()
// here, entries.map { entry -> entry.toPair() }
// is List<Pair<String,Int>> i.e Iterable<Pair<K, V>>.toMap()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment