diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2008-05-09 15:59:15 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2008-05-09 15:59:15 +0000 |
commit | 258597d9d8a7ac6e600eb47b5f26644bd8e8c6cd (patch) | |
tree | c296799e35a4c42974f520369019804509cb51d3 /src/main/java/com/amazon/carbonado/repo/map | |
parent | 06d5dbc5313f2c1686cff1664460f1eced7510f2 (diff) |
Test fixes.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/map')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/map/Key.java | 8 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/map/MapStorage.java | 7 |
2 files changed, 7 insertions, 8 deletions
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<S extends Storable> implements Comparable<Key<S>> { public int compareTo(Key<S> 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<S extends Storable> break;
}
- map = map.tailMap(startKey, true);
+ Key<S> ceilingKey = map.ceilingKey(startKey);
+ if (ceilingKey == null) {
+ return EmptyCursor.the();
+ }
+
+ map = map.tailMap(ceilingKey, true);
}
Cursor<S> cursor;
|