3 ms·
That doesn't necessarily work if you're doing the operation in a loop, unless the compiler also unrolls the loop to some degree (which isn't a zero-instruction
by JoshTriplett 7y ago
That doesn't necessarily work if you're doing the operation in a loop, unless the compiler also unrolls the loop to some degree (which isn't a zero-instruction change). It also only applies to local variables, and doesn't apply when swapping global or in-memory data.
I've rarely encountered a "swap" operation on local variables in straight-line code, as opposed to a loop, or a swap of global/in-memory values.