X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2Fengine%2FIndex.java;h=67f01fa48bb4f1dd9f6ffc1b1353e39b47ab24a0;hb=ae9f9d1df62d7f5c5b33bfcc99aee9c29ebe0bb9;hp=5b7b43d5aadd20a39a3de5e047b3ca348cdd7b83;hpb=5f7b259669237dad4cbfdec8536537815846979b;p=Dictionary.git diff --git a/src/com/hughes/android/dictionary/engine/Index.java b/src/com/hughes/android/dictionary/engine/Index.java index 5b7b43d..67f01fa 100644 --- a/src/com/hughes/android/dictionary/engine/Index.java +++ b/src/com/hughes/android/dictionary/engine/Index.java @@ -136,10 +136,11 @@ public final class Index { stoplist.add(raf.readUTF()); } } else if (dict.dictFileVersion >= 4) { - raf.readInt(); // length - raf.skipBytes(52); stoplist = new HashSet<>(); - byte b; + raf.readInt(); // length + raf.skipBytes(18); + byte b = raf.readByte(); + raf.skipBytes(b == 'L' ? 71 : 33); while ((b = raf.readByte()) == 0x74) { stoplist.add(raf.readUTF()); } @@ -530,7 +531,7 @@ public final class Index { swapPairEntries); for (final Collection rows : matches.values()) { final List ordered = new ArrayList<>(rows); - ordered.sort(lengthComparator); + Collections.sort(ordered, lengthComparator); result.addAll(ordered); }