andi Sun, 09 Aug 2009 04:46:02 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=286940
Log:
- Optimize slightly for common case - n!=4
Changed paths:
U php/php-src/trunk/Zend/zend_alloc.c
Modified: php/php-src/trunk/Zend/zend_alloc.c
===================================================================
--- php/php-src/trunk/Zend/zend_alloc.c 2009-08-09 04:22:00 UTC (rev 286939)
+++ php/php-src/trunk/Zend/zend_alloc.c 2009-08-09 04:46:02 UTC (rev 286940)
@@ -730,12 +730,14 @@
unsigned int n;
unsigned int index = 0;
- do {
- n = offset[_size & 15];
+ n = offset[_size & 15];
+ while (n == 4) {
_size >>= 4;
index += n;
- } while (n == 4);
- return index;
+ n = offset[_size & 15];
+ }
+
+ return index + n;
#endif
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php