Refactor 10-lines switch into ternary if.

Also remove dangling tab line before.
Merge pull request #1 from Xender/patch-1

Refactor 10-lines switch into ternary if.