From 649b4262c4483f12ec4d82549b9860e2f88d33b8 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 27 Aug 2011 18:01:40 +0000 Subject: Fixed bug in Sorted "to" not using the ordering. --- src/library/scala/collection/generic/Sorted.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/library') 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 -- cgit v1.2.3