Skip to content

Commit 1a61d29

Browse files
committed
Use zend_new_pair
1 parent e21de85 commit 1a61d29

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/simplexml/simplexml.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,17 +956,13 @@ static void sxe_properties_add(HashTable *rv, char *name, int namelen, zval *val
956956
{
957957
zend_string *key;
958958
zval *data_ptr;
959-
zval newptr;
960959

961960
key = zend_string_init(name, namelen, 0);
962961
if ((data_ptr = zend_hash_find(rv, key)) != NULL) {
963962
if (Z_TYPE_P(data_ptr) == IS_ARRAY) {
964963
zend_hash_next_index_insert_new(Z_ARRVAL_P(data_ptr), value);
965964
} else {
966-
array_init(&newptr);
967-
zend_hash_next_index_insert_new(Z_ARRVAL(newptr), data_ptr);
968-
zend_hash_next_index_insert_new(Z_ARRVAL(newptr), value);
969-
ZVAL_ARR(data_ptr, Z_ARR(newptr));
965+
ZVAL_ARR(data_ptr, zend_new_pair(data_ptr, value));
970966
}
971967
} else {
972968
zend_hash_add_new(rv, key, value);

0 commit comments

Comments
 (0)