Simplify casting expression

This commit is contained in:
Laurent Clouet
2015-03-31 22:04:09 +01:00
parent 12e1a11065
commit ad6547d3d9

View File

@@ -186,16 +186,10 @@ public class Worker {
}
if (method != null) {
if (method.equalsIgnoreCase("cpu")) {
compute_method = ComputeType.CPU_ONLY;
try {
compute_method = ComputeType.valueOf(method);
}
else if (method.equalsIgnoreCase("gpu")) {
compute_method = ComputeType.GPU_ONLY;
}
else if (method.equalsIgnoreCase("cpu_gpu") || method.equalsIgnoreCase("gpu_cpu")) {
compute_method = ComputeType.CPU_GPU;
}
else {
catch (IllegalArgumentException e) {
System.err.println("Error: compute-method unknown");
System.exit(2);
}