Make IterableLike.toIterator more efficient
Override TraversableLike.toIterator which uses unnecessary toStream. Fixes SI-4802. Contributed by Yang Zhang. git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25302 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
c36ce496ed
commit
54c8166f67
|
@ -85,6 +85,8 @@ self =>
|
|||
iterator.reduceRight(op)
|
||||
override /*TraversableLike*/ def toIterable: Iterable[A] =
|
||||
thisCollection
|
||||
override /*TraversableLike*/ def toIterator: Iterator[A] =
|
||||
iterator
|
||||
override /*TraversableLike*/ def head: A =
|
||||
iterator.next
|
||||
|
||||
|
|
Loading…
Reference in New Issue