diff options
author | Martin Odersky <odersky@gmail.com> | 2007-05-01 14:51:14 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-05-01 14:51:14 +0000 |
commit | 2043c0ab2196216fc1021d6d92e270184a2c8f45 (patch) | |
tree | 8ab5885a761192b25b8f459507e517993ad1d7f6 /src/library | |
parent | 1cc06bb6976e2d211b6219cfa7cdfbaab193791e (diff) | |
download | scala-2043c0ab2196216fc1021d6d92e270184a2c8f45.tar.gz scala-2043c0ab2196216fc1021d6d92e270184a2c8f45.tar.bz2 scala-2043c0ab2196216fc1021d6d92e270184a2c8f45.zip |
fixed bug 1074
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Collection.scala | 10 | ||||
-rw-r--r-- | src/library/scala/collection/immutable/Set.scala | 2 | ||||
-rw-r--r-- | src/library/scala/collection/mutable/FlatHashTable.scala | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/library/scala/Collection.scala b/src/library/scala/Collection.scala index f3c09d9865..f187e88d23 100644 --- a/src/library/scala/Collection.scala +++ b/src/library/scala/Collection.scala @@ -38,10 +38,12 @@ trait Collection[+A] extends Iterable[A] { /** Defines the prefix of this object's <code>toString</code> representation. */ protected def stringPrefix : String = { - val string = this.getClass.getName - val idx = string.lastIndexOf('.' : Int) - if (idx != -1) string.substring(idx + 1) - else string + var string = this.getClass.getName + val idx1 = string.lastIndexOf('.' : Int) + if (idx1 != -1) string = string.substring(idx1 + 1) + val idx2 = string.indexOf('$') + if (idx2 != -1) string = string.substring(0, idx2) + string } } diff --git a/src/library/scala/collection/immutable/Set.scala b/src/library/scala/collection/immutable/Set.scala index 8068615191..a759ea4bcf 100644 --- a/src/library/scala/collection/immutable/Set.scala +++ b/src/library/scala/collection/immutable/Set.scala @@ -178,6 +178,6 @@ trait Set[A] extends AnyRef with collection.Set[A] { * @param p The predicate used to filter the set */ override def filter(p: A => Boolean): Set[A] = - foldLeft(this)((set, elem) => if (p(elem)) set else set - elem) + (this /: toList)((set, elem) => if (p(elem)) set else set - elem) } diff --git a/src/library/scala/collection/mutable/FlatHashTable.scala b/src/library/scala/collection/mutable/FlatHashTable.scala index d968e97c8b..4cf1e8f5aa 100644 --- a/src/library/scala/collection/mutable/FlatHashTable.scala +++ b/src/library/scala/collection/mutable/FlatHashTable.scala @@ -71,7 +71,7 @@ trait FlatHashTable[A] { } def removeEntry(elem: A) { - checkConsistent() + if (tableDebug) checkConsistent() def precedes(i: int, j: int) = { val d = table.length >> 1 if (i <= j) j - i < d |