code cleanup for invertOperatorForOperandSwap()