Rearrange the check for switches that cause early exit.