Shift Switcher code cleanup:
Use prefix instead of postfix increment and decrement.
Declaration and assignment of local variables in one line.
Merged if statements.
Added brackets to for loops.
Fixed indentation.
Added and removed newlines for better readability.
Added comment.
Approved by PS Jenkins bot, Sam Spilsbury.