28.10.2011, 18:10
'switch' is faster than 'ifs' if there are more than 2 checks. So your version is fine and is probably the best way to do it.
EDIT: About the above post you can achieve that in a switch with the default case.
EDIT: About the above post you can achieve that in a switch with the default case.