aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2019-08-12 03:05:37 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2019-08-12 03:05:37 +0000
commit48170577ddd2faf2ab43635a460a98315ebc0ac1 (patch)
treef26214bab84e34cc514702e831012da923e7071c /src/main
parentaaf7449a84bf6533485afd612f586b1794d2821f (diff)
downloadjackcess-48170577ddd2faf2ab43635a460a98315ebc0ac1.tar.gz
jackcess-48170577ddd2faf2ab43635a460a98315ebc0ac1.zip
fix handling of descending indexes
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/a97_indexes@1311 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java b/src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java
index 54c0b7c..6b68aea 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java
@@ -150,29 +150,25 @@ public class General97IndexCodes extends GeneralLegacyIndexCodes
}
}
- // FIXME, how to handle extra codes for non ascending?
if(extraCodes != null) {
+ // write the extra codes to the end
extraCodes.writeNibble(EXT_CODES_BOUNDS_NIBBLE);
extraCodes.writeTo(bout);
} else {
- // handle descending order by inverting the bytes
- if(!isAscending) {
-
- // we actually write the end byte before flipping the bytes, and write
- // another one after flipping
- bout.write(END_EXTRA_TEXT);
-
- // flip the bytes that we have written thus far for this text value
- IndexData.flipBytes(bout.getBytes(), prevLength,
- (bout.getLength() - prevLength));
- }
-
// write end extra text
bout.write(END_EXTRA_TEXT);
}
+
+ // handle descending order by inverting the bytes
+ if(!isAscending) {
+
+ // flip the bytes that we have written thus far for this text value
+ IndexData.flipBytes(bout.getBytes(), prevLength,
+ (bout.getLength() - prevLength));
+ }
}
private static void writeExtraCodes(int numSigChars, byte[] bytes,