rewrite swap, add xorswap

This commit is contained in:
Marc Chapman 2017-08-08 01:39:01 +01:00
parent 3d7c1bbbf7
commit f992b65b7c

View file

@ -96,7 +96,8 @@
//! x ^= y; /* x' = (x^y) */
//! y ^= x; /* y' = (y^(x^y)) = x */
//! x ^= y; /* x' = (x^y)^x = y */
inline_ void Swap(udword& x, udword& y) { x ^= y; y ^= x; x ^= y; }
inline_ void xorSwap(udword& x, udword& y) { x ^= y; y ^= x; x ^= y; }
inline_ void Swap(udword& x, udword& y) {int temp = x; x = y; y = temp; }
//! Little/Big endian (from Steve Baker's Cute Code Collection)
//!