diff options
author | mihaylov <mihaylov@epfl.ch> | 2005-03-24 11:16:01 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2005-03-24 11:16:01 +0000 |
commit | 424f8b40d525b05e88f88719ec4aceb5ce147431 (patch) | |
tree | eab447b1b860cbaa6fea1f7c24aae8d491a6681a /sources | |
parent | 528c8d14505d340a79344807be0fb21eea4760d4 (diff) | |
download | scala-424f8b40d525b05e88f88719ec4aceb5ce147431.tar.gz scala-424f8b40d525b05e88f88719ec4aceb5ce147431.tar.bz2 scala-424f8b40d525b05e88f88719ec4aceb5ce147431.zip |
- forward toList to the implementation in Iterator
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/Seq.scala | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/sources/scala/Seq.scala b/sources/scala/Seq.scala index e2732d8f99..f8c3b3eee2 100644 --- a/sources/scala/Seq.scala +++ b/sources/scala/Seq.scala @@ -140,14 +140,7 @@ trait Seq[+A] with PartialFunction[Int, A] with Iterable[A] { * * @return a list which enumerates all elements of this sequence. */ - def toList: List[A] = { - val it = elements; - var res: List[A] = Nil; - while (it.hasNext) { - res = it.next :: res; - } - res.reverse - } + def toList: List[A] = elements.toList; /** Customizes the <code>toString</code> method. * |