replacec the "optimized"("clever") byte swapping with a "naive" one.
the "optimized" version can be slower on modern compilers/cpus (reference: http://en.wikipedia.org/wiki/XOR_swap_algorithm#Reasons_for_avoidance_in_practice) or can even produce a wrong result