3 ms·
In a sorting algorithm, if the XOR swap (or any other trick) is faster, that seems a valid use case. The constraint being “this sort library should be correct f
by sokoloff 5y ago
In a sorting algorithm, if the XOR swap (or any other trick) is faster, that seems a valid use case. The constraint being “this sort library should be correct first and as fast as possible second.”
- jacquesm 5y agoI've implemented lots of sorting algorithms and have never found the XOR trick useful or faster. The main use was on very register constrained 8 bit machines but I haven't programmed on anything like that in assembly for years. Still, it's a neat trick.