3 ms·
In most cases swapping two variables with a temporary variable will be either zero-overhead -- because you've just changed the names you're referring to those v
by pjscott 5y ago
In most cases swapping two variables with a temporary variable will be either zero-overhead -- because you've just changed the names you're referring to those variables by, and the compiler knows it -- or very, very low-overhead. You're not actually saving any memory with the fancy tricks.