diff --git a/libraries/stdlib/src/kotlin/collections/Maps.kt b/libraries/stdlib/src/kotlin/collections/Maps.kt index 0f21a570f35..57dcfc176dd 100644 --- a/libraries/stdlib/src/kotlin/collections/Maps.kt +++ b/libraries/stdlib/src/kotlin/collections/Maps.kt @@ -40,6 +40,11 @@ fun Map.Entry.component2(): V { return getValue() } +/** Converts entry to Pair with key being first component and value being second */ +fun Map.Entry.toPair(): Pair { + return Pair(getKey(), getValue()) +} + /** * Returns the value for the given key or returns the result of the defaultValue function if there was no entry for the given key *