Cleanup: Use foreach whenever is possible

This commit is contained in:
Mathis Chenuet
2015-01-25 18:36:39 +00:00
committed by Laurent Clouet
parent c6dafb3bf6
commit 3ea4107dc1
4 changed files with 12 additions and 13 deletions

View File

@@ -82,9 +82,9 @@ public class Error {
public static ServerCode fromInt(int val) {
ServerCode[] As = ServerCode.values();
for (int i = 0; i < As.length; i++) {
if (As[i].getValue() == val) {
return As[i];
for (ServerCode A : As) {
if (A.getValue() == val) {
return A;
}
}
return ServerCode.UNKNOWN;