From 2649a9e1a9f102419d6aba3d248a1546eb3d0926 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 17 May 2017 21:01:08 +0300 Subject: [PATCH] Removed useless dereferences --- ext/standard/array.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ext/standard/array.c b/ext/standard/array.c index 48fd9734614..69c98d8b7a5 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)); } }