Hold back eachSumOf for a while.
This commit is contained in:
@@ -246,6 +246,7 @@ public fun <T, K> Grouping<T, K>.eachCount(): Map<K, Int> =
|
||||
public fun <T, K, M : MutableMap<in K, Int>> Grouping<T, K>.eachCountTo(destination: M): M =
|
||||
foldTo(destination, 0) { acc, _ -> acc + 1 }
|
||||
|
||||
/**
|
||||
/**
|
||||
* Groups elements from the [Grouping] source by key and sums values provided by the [valueSelector] function for elements in each group.
|
||||
*
|
||||
@@ -273,7 +274,7 @@ public inline fun <T, K> Grouping<T, K>.eachSumOf(valueSelector: (T) -> Int): Ma
|
||||
@SinceKotlin("1.1")
|
||||
public inline fun <T, K, M : MutableMap<in K, Int>> Grouping<T, K>.eachSumOfTo(destination: M, valueSelector: (T) -> Int): M =
|
||||
foldTo(destination, 0) { acc, e -> acc + valueSelector(e)}
|
||||
|
||||
*/
|
||||
|
||||
@JvmVersion
|
||||
@PublishedApi
|
||||
|
||||
Reference in New Issue
Block a user