Use switch statement instead of long if-else
This is a small readability improvement to some code I had to stare at recently.
Instead of having a long chain of else if
statements I think it is better to use switch
. This change also breaks some long lines.