Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c15bbb52 authored by Dan Zivkovic's avatar Dan Zivkovic
Browse files

Retire Delight2 migration code to speed up tests.

We're waiting 10 minutes for tests to run, and half of that time is spent in
depreacted code related to migration of Delight2 dictionary files.
LatinIME will never migrate another Delight2 dictionary file again, so we can
delete this code.

Change-Id: I05c7d8429e8d9a26139456763c77997340fea8c2
parent fe716f0f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -121,8 +121,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
    private static boolean needsToMigrateDictionary(final int formatVersion) {
        // When we bump up the dictionary format version, the old version should be added to here
        // for supporting migration. Note that native code has to support reading such formats.
        return formatVersion == FormatSpec.VERSION4_ONLY_FOR_TESTING
                || formatVersion == FormatSpec.VERSION402;
        return formatVersion == FormatSpec.VERSION402;
    }

    public boolean isValidDictionaryLocked() {
+0 −3
Original line number Diff line number Diff line
@@ -174,9 +174,6 @@ public final class FormatSpec {
    public static final int VERSION202 = 202;
    // format version for Fava Dictionaries.
    public static final int VERSION_DELIGHT3 = 86736212;
    public static final int MINIMUM_SUPPORTED_VERSION_OF_CODE_POINT_TABLE = VERSION201;
    // Dictionary version used for testing.
    public static final int VERSION4_ONLY_FOR_TESTING = 399;
    public static final int VERSION402 = 402;
    public static final int VERSION403 = 403;
    public static final int VERSION4 = VERSION403;
+21 −237

File changed.

Preview size limit exceeded, changes collapsed.

+2 −12
Original line number Diff line number Diff line
@@ -43,22 +43,12 @@ public final class BinaryDictIOUtils {
     */
    public static DictDecoder getDictDecoder(final File dictFile, final long offset,
            final long length, final int bufferType) {
        if (dictFile.isDirectory()) {
        return new Ver4DictDecoder(dictFile);
        } else if (dictFile.isFile()) {
            return new Ver2DictDecoder(dictFile, offset, length, bufferType);
        }
        return null;
    }

    public static DictDecoder getDictDecoder(final File dictFile, final long offset,
            final long length, final DictionaryBufferFactory factory) {
        if (dictFile.isDirectory()) {
        return new Ver4DictDecoder(dictFile);
        } else if (dictFile.isFile()) {
            return new Ver2DictDecoder(dictFile, offset, length, factory);
        }
        return null;
    }

    public static DictDecoder getDictDecoder(final File dictFile, final long offset,
+0 −319

File deleted.

Preview size limit exceeded, changes collapsed.

Loading