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() {
|
||||
String arch = System.getProperty("os.arch").toLowerCase();
|
||||
if (arch.equals("i386") || arch.equals("i686") || arch.equals("x86")) {
|
||||
switch (arch) {
|
||||
case "i386":
|
||||
case "i686":
|
||||
case "x86":
|
||||
this.arch = "32bit";
|
||||
}
|
||||
else if (arch.equals("amd64") || arch.equals("x86_64")) {
|
||||
break;
|
||||
case "amd64":
|
||||
case "x86_64":
|
||||
this.arch = "64bit";
|
||||
}
|
||||
else {
|
||||
break;
|
||||
default:
|
||||
this.arch = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user