com php-src: Removed useless dereferences: ext/standard/array.c

From: Date: Wed, 17 May 2017 18:01:08 +0000
Subject: com php-src: Removed useless dereferences: ext/standard/array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-97847@lists.php.net to get a copy of this message
Commit: 2649a9e1a9f102419d6aba3d248a1546eb3d0926 Author: Dmitry Stogov <dmitry@zend.com> Wed, 17 May 2017 21:01:08 +0300 Parents: ccb559172821f51e25c32f464aa910225b5c9bd4 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2649a9e1a9f102419d6aba3d248a1546eb3d0926 Log: Removed useless dereferences Changed paths: M ext/standard/array.c Diff: diff --git a/ext/standard/array.c b/ext/standard/array.c index 48fd973..69c98d8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1316,7 +1316,6 @@ PHP_FUNCTION(min) } } - ZVAL_DEREF(min); ZVAL_COPY(return_value, min); } } @@ -1363,7 +1362,6 @@ PHP_FUNCTION(max) } } - ZVAL_DEREF(max); ZVAL_COPY(return_value, max); } } @@ -3812,7 +3810,6 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE for (i = 0; i < argc; i++) { zval *arg = args + i; - ZVAL_DEREF(arg); if (Z_TYPE_P(arg) != IS_ARRAY) { php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); RETURN_NULL(); @@ -3825,19 +3822,16 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE /* copy first array */ arg = args; - ZVAL_DEREF(arg); dest = zend_array_dup(Z_ARRVAL_P(arg)); ZVAL_ARR(return_value, dest); if (recursive) { for (i = 1; i < argc; i++) { arg = args + i; - ZVAL_DEREF(arg); php_array_replace_recursive(dest, Z_ARRVAL_P(arg)); } } else { for (i = 1; i < argc; i++) { arg = args + i; - ZVAL_DEREF(arg); zend_hash_merge(dest, Z_ARRVAL_P(arg), zval_add_ref, 1); } } @@ -3846,7 +3840,6 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE HashTable *src, *dest; arg = args; - ZVAL_DEREF(arg); src = Z_ARRVAL_P(arg); /* copy first array */ array_init_size(return_value, zend_hash_num_elements(src)); @@ -3881,13 +3874,11 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE if (recursive) { for (i = 1; i < argc; i++) { arg = args + i; - ZVAL_DEREF(arg); php_array_merge_recursive(dest, Z_ARRVAL_P(arg)); } } else { for (i = 1; i < argc; i++) { arg = args + i; - ZVAL_DEREF(arg); php_array_merge(dest, Z_ARRVAL_P(arg)); } }

« previous php.cvs (#97847) next »