From 258597d9d8a7ac6e600eb47b5f26644bd8e8c6cd Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 9 May 2008 15:59:15 +0000 Subject: Test fixes. --- src/main/java/com/amazon/carbonado/repo/map/Key.java | 8 +------- src/main/java/com/amazon/carbonado/repo/map/MapStorage.java | 7 ++++++- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') diff --git a/src/main/java/com/amazon/carbonado/repo/map/Key.java b/src/main/java/com/amazon/carbonado/repo/map/Key.java index 5032f66..218ded6 100644 --- a/src/main/java/com/amazon/carbonado/repo/map/Key.java +++ b/src/main/java/com/amazon/carbonado/repo/map/Key.java @@ -67,13 +67,7 @@ class Key implements Comparable> { public int compareTo(Key other) { int result = mComparator.compare(mStorable, other.mStorable); if (result == 0) { - int t1 = tieBreaker(); - int t2 = other.tieBreaker(); - if (t1 < t2) { - result = -1; - } else if (t1 > t2) { - result = 1; - } + result = tieBreaker() - other.tieBreaker(); } return result; } diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java index c8a6e9c..1457fae 100644 --- a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java @@ -682,7 +682,12 @@ class MapStorage break; } - map = map.tailMap(startKey, true); + Key ceilingKey = map.ceilingKey(startKey); + if (ceilingKey == null) { + return EmptyCursor.the(); + } + + map = map.tailMap(ceilingKey, true); } Cursor cursor; -- cgit v1.2.3