A switch with only case 0: and default: is just an if and would be better written as such, especially when one branch is empty.