]> granicus.if.org Git - php/commitdiff
Micro optimization
authorXinchen Hui <laruence@php.net>
Sat, 20 Jun 2015 02:48:18 +0000 (10:48 +0800)
committerXinchen Hui <laruence@php.net>
Sat, 20 Jun 2015 02:52:58 +0000 (10:52 +0800)
ext/standard/array.c

index a8e56c07cde039a8bee914f96bcfd0bfc10c5c51..fdfb9107d98a0388cb36a2658c6539b698659603 100644 (file)
@@ -2750,7 +2750,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ *
 }
 /* }}} */
 
-static void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int recursive, int replace) /* {{{ */
+static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETERS, int recursive, int replace) /* {{{ */
 {
        zval *args = NULL;
        zval *arg;
@@ -2989,7 +2989,7 @@ PHP_FUNCTION(array_values)
        /* Go through input array and add values to the return array */
        ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) {
                ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(input), entry) {
-                       if (Z_ISREF_P(entry) && Z_REFCOUNT_P(entry) == 1) {
+                       if (UNEXPECTED(Z_ISREF_P(entry) && Z_REFCOUNT_P(entry) == 1)) {
                                entry = Z_REFVAL_P(entry);
                        }
                        Z_TRY_ADDREF_P(entry);