Ported 'ConvertSwitchToIfAction'.
Merge pull request #441 from TheCommieDuck/switch-to-if

Ported 'ConvertSwitchToIfAction'.