In the depths of the Internet I found the following post:
Swapping two numbers without using a new variable is always a good approach. This helps your application to be memory and performance oriented.
And it proposes to use the following code:
int firstNum = 10; int secondNum = 20; firstNum = firstNum + secondNum; secondNum = firstNum - secondNum; firstNum = firstNum - secondNum; instead of using a temporary variable.
To be honest it sounds for me like a bunch of baloney. I know, that in a real environment such microtweaks wouldn't do almost any difference, but what intrigues me is, if avoiding using a new variable, in this case, would do any difference?
firstNum + secondNumoverflow you're netherwockered.