]> source.dussan.org Git - jackcess.git/commitdiff
fix handling of descending indexes
authorJames Ahlborn <jtahlborn@yahoo.com>
Mon, 12 Aug 2019 03:05:37 +0000 (03:05 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Mon, 12 Aug 2019 03:05:37 +0000 (03:05 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/a97_indexes@1311 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/General97IndexCodes.java

index 54c0b7c348ff806cc1505832ce43cb2c16ae19bf..6b68aeaf02c75c5619253add5c6dfed3397cd87a 100644 (file)
@@ -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,