Simplify casting expression
This commit is contained in:
@@ -186,16 +186,10 @@ public class Worker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (method != null) {
|
if (method != null) {
|
||||||
if (method.equalsIgnoreCase("cpu")) {
|
try {
|
||||||
compute_method = ComputeType.CPU_ONLY;
|
compute_method = ComputeType.valueOf(method);
|
||||||
}
|
}
|
||||||
else if (method.equalsIgnoreCase("gpu")) {
|
catch (IllegalArgumentException e) {
|
||||||
compute_method = ComputeType.GPU_ONLY;
|
|
||||||
}
|
|
||||||
else if (method.equalsIgnoreCase("cpu_gpu") || method.equalsIgnoreCase("gpu_cpu")) {
|
|
||||||
compute_method = ComputeType.CPU_GPU;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
System.err.println("Error: compute-method unknown");
|
System.err.println("Error: compute-method unknown");
|
||||||
System.exit(2);
|
System.exit(2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user