Add flatMap sample KT-20357
This commit is contained in:
committed by
Ilya Gorbunov
parent
29b25e3901
commit
664d69b752
@@ -39,6 +39,8 @@ public fun <K, V> Map<out K, V>.toList(): List<Pair<K, V>> {
|
||||
|
||||
/**
|
||||
* Returns a single list of all elements yielded from results of [transform] function being invoked on each entry of original map.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.flatMap
|
||||
*/
|
||||
public inline fun <K, V, R> Map<out K, V>.flatMap(transform: (Map.Entry<K, V>) -> Iterable<R>): List<R> {
|
||||
return flatMapTo(ArrayList<R>(), transform)
|
||||
|
||||
Reference in New Issue
Block a user