diff options
author | Martin Odersky <odersky@gmail.com> | 2008-06-17 17:44:30 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-06-17 17:44:30 +0000 |
commit | 9077de63b9f5d596b8ea3df5baeac3f87835e7a2 (patch) | |
tree | 1fda0912e5bb534366478dc0cba91ea1475ba767 /src/library | |
parent | d34d51d220bd24e54f38e069250db8b692dc0178 (diff) | |
download | scala-9077de63b9f5d596b8ea3df5baeac3f87835e7a2.tar.gz scala-9077de63b9f5d596b8ea3df5baeac3f87835e7a2.tar.bz2 scala-9077de63b9f5d596b8ea3df5baeac3f87835e7a2.zip |
fixed some bugs; disabled devirtualize; desiabl...
fixed some bugs; disabled devirtualize; desiabled bells in JLineReader;
fixed Gilles problems with GADTs
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/List.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala index f6f10161d6..23667f68d7 100644 --- a/src/library/scala/List.scala +++ b/src/library/scala/List.scala @@ -1276,8 +1276,15 @@ sealed abstract class List[+A] extends Seq[A] { * @return this list without the elements of the given object * <code>x</code>. */ - def - [B >: A](x: B): List[B] = - this -- List(x) + def - [B >: A](x: B): List[B] = { + val b = new ListBuffer[B] + var these = this + while (!these.isEmpty) { + if (these.head != x) b += these.head + these = these.tail + } + b.toList + } /** Concatenate the elements of this list. The elements of this list * should be a <code>Iterables</code>. |