123 points · by jenningsjason · 15y ago · 15 comments
[1] http://store.steampowered.com/stats/ [2] http://majornelson.com/2011/08/10/live-activity-for-week-of-...
Also interesting note regarding readability of bitwise operations at the end of the Networking section.
Edit: Found more about this exact substitution on Wikipedia, of all places. :)
http://en.wikipedia.org/wiki/Modulo_operation#Performance_is...
Also even if it was unsigned, but % was used then people might have the idea that any value could be used, while if & was used - it's more clear (at least to me) that power of 2 - 1 mask is needed - it just brings the right message.
The only case where % would've been used in similar fashion is in a hash-table, where the number of elements in the current bucket is prime number.
In the same spirit - & rather than % for that example.
"I happily dove into Quake World source code."