acidmoose/cloudname — comment on commit 4a287e304e0315517a5cb1750349b283d7c1f4d1
File: flags/src/main/java/org/cloudname/flags/Flags.java line 75
By borud:

whenever you end up with an if/else it is usually a switch()-statement waiting to get out. (you can do switch with enums as well)

(this isn't performance oriented code, but if/else is not very readable because it requires people to scan up and down the code and to try to match up indentation levels visually. but if it was performance-sensitive you would speed up the code considerably because you give the compiler a lot more freedom. a switch can be made into a jump table with a maximum runtime complexity of O(1). if/else may produce a hard requirement for an O(N) runtime)