12 Apr
2007
12 Apr
'07
8:27 a.m.
On 11 Apr 2007, at 03:55, Karoly Negyesi wrote:
* modulo is slower than bitwise-and and I think that this was the main culprit to the even/odd flip performance
But the patch was a bugfix and the race was between
$class = $class == 'even' ? 'odd' : 'even'
$class = $flip[$class];
Because the key is not reliable, so we must flip the class.
Yes, in that particular patch, the if-test would sometimes break (depending on the input data). The patch fixed a bug, and the tiny performance improvement was just a secondary effect. -- Dries Buytaert :: http://www.buytaert.net/