diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-03-21 19:25:44 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-03-21 19:25:44 +0000 |
commit | 6a2134b1b056da1c32115b4ab87e11c7b78b53ab (patch) | |
tree | 21a7f25e9118098af611356f21b59f68a2e84fcc /src/library | |
parent | 1052ad2f1ea1d162f65c3e3663a54d44e5566578 (diff) | |
download | scala-6a2134b1b056da1c32115b4ab87e11c7b78b53ab.tar.gz scala-6a2134b1b056da1c32115b4ab87e11c7b78b53ab.tar.bz2 scala-6a2134b1b056da1c32115b4ab87e11c7b78b53ab.zip |
Major rewrite of optimization phases.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/List.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala index 73d633515a..b6723b5517 100644 --- a/src/library/scala/List.scala +++ b/src/library/scala/List.scala @@ -666,7 +666,7 @@ sealed abstract class List[+a] extends Seq[a] { * @param f function to apply to each element. * @return <code>[f(a0), ..., f(an)]</code> if this list is <code>[a0, ..., an]</code>. */ - override def map[b](f: a => b): List[b] = { + final override def map[b](f: a => b): List[b] = { val b = new ListBuffer[b] var these = this while (!these.isEmpty) { @@ -696,7 +696,7 @@ sealed abstract class List[+a] extends Seq[a] { * * @param f the treatment to apply to each element. */ - override def foreach(f: a => Unit): Unit = { + final override def foreach(f: a => Unit): Unit = { var these = this while (!these.isEmpty) { f(these.head) @@ -710,7 +710,7 @@ sealed abstract class List[+a] extends Seq[a] { * @param p the predicate used to filter the list. * @return the elements of this list satisfying <code>p</code>. */ - override def filter(p: a => Boolean): List[a] = { + final override def filter(p: a => Boolean): List[a] = { // return same list if all elements satisfy p var these = this while (!these.isEmpty && p(these.head)) { @@ -964,7 +964,7 @@ sealed abstract class List[+a] extends Seq[a] { * @return <code>f(a<sub>0</sub>) ::: ... ::: f(a<sub>n</sub>)</code> if * this list is <code>[a<sub>0</sub>, ..., a<sub>n</sub>]</code>. */ - override def flatMap[b](f: a => Iterable[b]): List[b] = { + final override def flatMap[b](f: a => Iterable[b]): List[b] = { val b = new ListBuffer[b] var these = this while (!these.isEmpty) { |