]> granicus.if.org Git - php/commitdiff
optimize loops. The check only exists for integers because that's the more
authorSterling Hughes <sterling@php.net>
Wed, 21 May 2003 18:46:34 +0000 (18:46 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 21 May 2003 18:46:34 +0000 (18:46 +0000)
common optimization, and you actually lose performance if you check for
a double too (wierd but true).

Zend/zend_operators.c

index 8915ca90a40d9813f975d4c682b96ca4875858ba..f89d119fc58d5f26afd2c21b6185f6e1210eb392 100644 (file)
@@ -144,7 +144,9 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
 
 #define zendi_convert_scalar_to_number(op, holder, result)                     \
        if (op==result) {                                                                                               \
-               convert_scalar_to_number(op TSRMLS_CC);                                         \
+               if (op->type != IS_LONG) {                                                                      \
+                       convert_scalar_to_number(op TSRMLS_CC);                                 \
+               }                                                                                                                       \
        } else {                                                                                                                \
                switch ((op)->type) {                                                                           \
                        case IS_STRING:                                                                                 \