Skip to content

Commit 88072e0

Browse files
author
wxxiong6
authored
Update arraylist.c
1 parent dc4e353 commit 88072e0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

arraylist.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,12 @@ static void destruct(arraylist *array)/* {{{ */
8383

8484
static void arraylist_init(arraylist *array, zend_long size) /* {{{ */
8585
{
86-
if (size > 0) {
87-
array->size = 0; /* reset size in case ecalloc() fails */
86+
87+
array->size = 0; /* reset size in case ecalloc() fails */
8888
array->key = 0;
89-
array->elements = NULL;
90-
array->elements = (zval *)ecalloc(size, sizeof(zval));
91-
array->size = size;
92-
}
93-
89+
array->elements = NULL;
90+
array->elements = (zval *)ecalloc(size, sizeof(zval));
91+
array->size = size;
9492
}
9593
/* }}} */
9694

@@ -389,4 +387,4 @@ zend_module_entry arraylist_module_entry = {
389387
ZEND_TSRMLS_CACHE_DEFINE()
390388
# endif
391389
ZEND_GET_MODULE(arraylist)
392-
#endif
390+
#endif

0 commit comments

Comments
 (0)