diff options
author | Dmitry Stogov <dmitry@php.net> | 2009-03-18 11:25:37 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2009-03-18 11:25:37 +0000 |
commit | 69ce7ea442c11c1751b18f21627d82ce2ffba561 (patch) | |
tree | b83d9bd1a65bad48f3b2941c5b248d5061af7afd | |
parent | 13db8cb25a5bbf20a5f99b32ed901818b4ef4d3b (diff) | |
download | php-git-69ce7ea442c11c1751b18f21627d82ce2ffba561.tar.gz |
optimization
-rw-r--r-- | Zend/zend_operators.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index ce1afff8d0..e8b579f8e2 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1736,10 +1736,10 @@ ZEND_API int increment_function(zval *op1) case IS_STRING: { long lval; double dval; - char *strval = Z_STRVAL_P(op1); - switch (is_numeric_string(strval, Z_STRLEN_P(op1), &lval, &dval, 0)) { + switch (is_numeric_string(Z_STRVAL_P(op1), Z_STRLEN_P(op1), &lval, &dval, 0)) { case IS_LONG: + efree(Z_STRVAL_P(op1)); if (lval == LONG_MAX) { /* switch to double */ double d = (double)lval; @@ -1747,11 +1747,10 @@ ZEND_API int increment_function(zval *op1) } else { ZVAL_LONG(op1, lval+1); } - efree(strval); /* should never be empty_string */ break; case IS_DOUBLE: + efree(Z_STRVAL_P(op1)); ZVAL_DOUBLE(op1, dval+1); - efree(strval); /* should never be empty_string */ break; default: /* Perl style string increment */ |