Add sample for Map.asSequence (#5055)

This commit is contained in:
Takumi Maeomote
2022-12-16 01:58:38 +09:00
committed by GitHub
parent a529f8510d
commit c4f83adc2a
3 changed files with 11 additions and 1 deletions
@@ -584,6 +584,8 @@ public inline fun <K, V> Map<out K, V>.asIterable(): Iterable<Map.Entry<K, V>> {
/**
* Creates a [Sequence] instance that wraps the original map returning its entries when being iterated.
*
* @sample samples.collections.Sequences.Building.sequenceFromMap
*/
public fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>> {
return entries.asSequence()