I was chatting with a co-worker the other day about unnecessary code optimizations that make your code look like it’s going to run faster. Here’s an example:
int x = x * 2; // x *= 2
And here’s the riced up version:
int x = x << 1; // x <<= 1
If you think the second version will run faster you too may be a code ricer.
Got more examples? Leave a comment.
It can be faster on embedded systems.