aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/healthmarketscience/jackcess/Index.java
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2006-09-23 18:45:11 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2006-09-23 18:45:11 +0000
commit23423a0a369af9187e74615f09299c39fd337e60 (patch)
treef47a43153de355342269a4482012b56522cf14a1 /src/java/com/healthmarketscience/jackcess/Index.java
parent78c26cb7fe9a4e20b7e6dfca3e375a3c0c927134 (diff)
downloadjackcess-23423a0a369af9187e74615f09299c39fd337e60.tar.gz
jackcess-23423a0a369af9187e74615f09299c39fd337e60.zip
fix ordering of byte code comparator
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@120 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com/healthmarketscience/jackcess/Index.java')
-rw-r--r--src/java/com/healthmarketscience/jackcess/Index.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Index.java b/src/java/com/healthmarketscience/jackcess/Index.java
index 7c51191..1b3febe 100644
--- a/src/java/com/healthmarketscience/jackcess/Index.java
+++ b/src/java/com/healthmarketscience/jackcess/Index.java
@@ -60,7 +60,7 @@ public class Index implements Comparable<Index> {
private static final byte REVERSE_ORDER_FLAG = (byte)0x01;
- private static final Comparator<byte[]> BYTE_CODE_COMPARATOR =
+ static final Comparator<byte[]> BYTE_CODE_COMPARATOR =
new Comparator<byte[]>() {
public int compare(byte[] left, byte[] right) {
if(left == right) {
@@ -79,7 +79,8 @@ public class Index implements Comparable<Index> {
++pos;
}
if(pos < len) {
- return ((left[pos] < right[pos]) ? -1 : 1);
+ return ((ByteUtil.toUnsignedInt(left[pos]) <
+ ByteUtil.toUnsignedInt(right[pos])) ? -1 : 1);
}
return ((left.length < right.length) ? -1 :
((left.length > right.length) ? 1 : 0));