summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-03-24 11:16:01 +0000
committermihaylov <mihaylov@epfl.ch>2005-03-24 11:16:01 +0000
commit424f8b40d525b05e88f88719ec4aceb5ce147431 (patch)
treeeab447b1b860cbaa6fea1f7c24aae8d491a6681a
parent528c8d14505d340a79344807be0fb21eea4760d4 (diff)
downloadscala-424f8b40d525b05e88f88719ec4aceb5ce147431.tar.gz
scala-424f8b40d525b05e88f88719ec4aceb5ce147431.tar.bz2
scala-424f8b40d525b05e88f88719ec4aceb5ce147431.zip
- forward toList to the implementation in Iterator
-rw-r--r--sources/scala/Seq.scala9
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.
*