com php-src: Simplify the code and use zend_hash_next_ind ex_insert(): ext/standard/array.c

From: Date: Fri, 11 Jan 2013 20:16:19 +0000
Subject: com php-src: Simplify the code and use zend_hash_next_ind ex_insert(): ext/standard/array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-71663@lists.php.net to get a copy of this message
Commit: 6a27b890e6d643f17072e561a5d4f87211195a7c Author: Ben Ramsey <ramsey@php.net> Sat, 14 Apr 2012 02:39:25 -0500 Parents: dc4dfe8ae019ec1fddc05ac340ed612a9c3f6d34 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6a27b890e6d643f17072e561a5d4f87211195a7c Log: Simplify the code and use zend_hash_next_index_insert() Changed paths: M ext/standard/array.c Diff: diff --git a/ext/standard/array.c b/ext/standard/array.c index b707301..c5d0fa7 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2613,31 +2613,8 @@ PHP_FUNCTION(array_column) continue; } - switch (Z_TYPE_PP(zvalue)) { - case IS_NULL: - add_next_index_null(return_value); - break; - case IS_LONG: - add_next_index_long(return_value, Z_LVAL_PP(zvalue)); - break; - case IS_DOUBLE: - add_next_index_double(return_value, Z_DVAL_PP(zvalue)); - break; - case IS_BOOL: - add_next_index_bool(return_value, Z_BVAL_PP(zvalue)); - break; - case IS_OBJECT: - zval_add_ref(zvalue); - add_next_index_zval(return_value, *zvalue); - break; - case IS_STRING: - add_next_index_stringl(return_value, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 1); - break; - case IS_RESOURCE: - zval_add_ref(zvalue); - add_next_index_resource(return_value, Z_RESVAL_PP(zvalue)); - break; - } + Z_ADDREF_PP(zvalue); + zend_hash_next_index_insert(HASH_OF(return_value), (void **)zvalue, sizeof(zval *), NULL); } }

« previous php.cvs (#71663) next »