Use a switch statement in mapDexVersionToApi

This commit is contained in:
Lanchon 2018-06-14 05:13:18 -03:00 committed by Ben Gruver
parent a237739444
commit 2f29256bdf

View File

@ -35,20 +35,19 @@ public class VersionMap {
public static final int NO_VERSION = -1; public static final int NO_VERSION = -1;
public static int mapDexVersionToApi(int dexVersion) { public static int mapDexVersionToApi(int dexVersion) {
if (dexVersion == 35) { switch (dexVersion) {
case 35:
return 23; return 23;
} case 37:
if (dexVersion == 37) {
return 25; return 25;
} case 38:
if (dexVersion == 38) {
return 27; return 27;
} case 39:
if (dexVersion == 39) {
return 28; return 28;
} default:
return NO_VERSION; return NO_VERSION;
} }
}
public static int mapApiToDexVersion(int api) { public static int mapApiToDexVersion(int api) {
if (api <= 23) { if (api <= 23) {