From 7273f223f41b1191256384618e8aa78160d44f9b Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 9 Jun 2014 23:18:41 +0400 Subject: [PATCH] Remove Map.groupBy --- libraries/stdlib/src/generated/_Mapping.kt | 19 ------------------- .../src/templates/Mapping.kt | 2 -- 2 files changed, 21 deletions(-) diff --git a/libraries/stdlib/src/generated/_Mapping.kt b/libraries/stdlib/src/generated/_Mapping.kt index 36f29d62c67..ab4de4fc0a6 100644 --- a/libraries/stdlib/src/generated/_Mapping.kt +++ b/libraries/stdlib/src/generated/_Mapping.kt @@ -311,13 +311,6 @@ public inline fun Iterable.groupBy(toKey: (T) -> K): Map> { return groupByTo(HashMap>(), toKey) } -/** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function - */ -public inline fun Map.groupBy(toKey: (Map.Entry) -> K): Map>> { - return groupByTo(HashMap>>(), toKey) -} - /** * Returns a map of the elements in original collection grouped by the result of given *toKey* function */ @@ -452,18 +445,6 @@ public inline fun Iterable.groupByTo(map: MutableMap return map } -/** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* - */ -public inline fun Map.groupByTo(map: MutableMap>>, toKey: (Map.Entry) -> K): Map>> { - for (element in this) { - val key = toKey(element) - val list = map.getOrPut(key) { ArrayList>() } - list.add(element) - } - return map -} - /** * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* */ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt index b1416a96181..18f2438deb5 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt @@ -185,7 +185,6 @@ fun mapping(): List { typeParam("K") returns("Map>") body { "return groupByTo(HashMap>(), toKey)" } - include(Maps) } templates add f("groupByTo(map: MutableMap>, toKey: (T) -> K)") { @@ -204,7 +203,6 @@ fun mapping(): List { return map """ } - include(Maps) } return templates } \ No newline at end of file