stdlib: stream() for Map #KT-6547 Fixed
This commit is contained in:
@@ -119,6 +119,17 @@ public fun <T> Iterable<T>.stream(): Stream<T> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream from the given collection
|
||||
*/
|
||||
public fun <K, V> Map<K, V>.stream(): Stream<Map.Entry<K, V>> {
|
||||
return object : Stream<Map.Entry<K, V>> {
|
||||
override fun iterator(): Iterator<Map.Entry<K, V>> {
|
||||
return this@stream.iterator()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream from the given collection
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user