use switch instead of ifs
This commit is contained in:
committed by
Laurent Clouet
parent
40de3e150d
commit
c3064de5e9
@@ -70,14 +70,19 @@ public class CPU {
|
|||||||
|
|
||||||
public void generateArch() {
|
public void generateArch() {
|
||||||
String arch = System.getProperty("os.arch").toLowerCase();
|
String arch = System.getProperty("os.arch").toLowerCase();
|
||||||
if (arch.equals("i386") || arch.equals("i686") || arch.equals("x86")) {
|
switch (arch) {
|
||||||
this.arch = "32bit";
|
case "i386":
|
||||||
}
|
case "i686":
|
||||||
else if (arch.equals("amd64") || arch.equals("x86_64")) {
|
case "x86":
|
||||||
this.arch = "64bit";
|
this.arch = "32bit";
|
||||||
}
|
break;
|
||||||
else {
|
case "amd64":
|
||||||
this.arch = null;
|
case "x86_64":
|
||||||
|
this.arch = "64bit";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.arch = null;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user