Minor: remove anonymous class for Map.asSequence

This commit is contained in:
Ilya Gorbunov
2016-08-03 16:50:15 +03:00
parent fb99919c59
commit bb774cea76
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -193,6 +193,6 @@ 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. * Creates a [Sequence] instance that wraps the original map returning its entries when being iterated.
*/ */
public fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>> { public fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>> {
return Sequence { this.iterator() } return entries.asSequence()
} }
@@ -42,6 +42,8 @@ fun sequences(): List<GenericFunction> {
""" """
} }
body(Maps) { "return entries.asSequence()" }
doc(Sequences) { "Returns this sequence as a [Sequence]."} doc(Sequences) { "Returns this sequence as a [Sequence]."}
inline(Sequences) { Inline.Only } inline(Sequences) { Inline.Only }
body(Sequences) { "return this" } body(Sequences) { "return this" }