summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-08-27 18:01:40 +0000
committerPaul Phillips <paulp@improving.org>2011-08-27 18:01:40 +0000
commit649b4262c4483f12ec4d82549b9860e2f88d33b8 (patch)
tree6cd9e426471e7827223589717d6ae51c54884bc1 /src/library
parent3efce112b5759c04566055b8418261d13e474e1e (diff)
downloadscala-649b4262c4483f12ec4d82549b9860e2f88d33b8.tar.gz
scala-649b4262c4483f12ec4d82549b9860e2f88d33b8.tar.bz2
scala-649b4262c4483f12ec4d82549b9860e2f88d33b8.zip
Fixed bug in Sorted "to" not using the ordering.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/collection/generic/Sorted.scala3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/library/scala/collection/generic/Sorted.scala b/src/library/scala/collection/generic/Sorted.scala
index 7a3a220683..ed9e11fd30 100644
--- a/src/library/scala/collection/generic/Sorted.scala
+++ b/src/library/scala/collection/generic/Sorted.scala
@@ -71,11 +71,10 @@ trait Sorted[K, +This <: Sorted[K, This]] {
* @param to The upper-bound (inclusive) of the ranged projection.
*/
def to(to: K): This = {
- // tough!
val i = keySet.from(to).iterator
if (i.isEmpty) return repr
val next = i.next
- if (next == to)
+ if (compare(next, to) == 0)
if (i.isEmpty) repr
else until(i.next)
else