summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-03-21 19:25:44 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-03-21 19:25:44 +0000
commit6a2134b1b056da1c32115b4ab87e11c7b78b53ab (patch)
tree21a7f25e9118098af611356f21b59f68a2e84fcc /src/library
parent1052ad2f1ea1d162f65c3e3663a54d44e5566578 (diff)
downloadscala-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.scala8
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) {