Update `distinct()`.

This commit is contained in:
CismonX 2018-08-29 00:55:21 +08:00
parent 43d19eeb9f
commit 1ce0386a2f
1 changed files with 1 additions and 1 deletions

View File

@ -898,7 +898,7 @@ PHP_METHOD(Collection, distinct)
zend_array* current = COLLECTION_FETCH_CURRENT();
compare_func_t cmp = NULL;
equal_check_func_t eql = NULL;
Bucket* ref = (Bucket*)malloc((zend_hash_num_elements(current) + 1) * sizeof(Bucket));
Bucket* ref = (Bucket*)malloc(zend_hash_num_elements(current) * sizeof(Bucket));
ARRAY_CLONE(distinct, current);
uint32_t idx = 0;
ZEND_HASH_FOREACH_BUCKET(distinct, Bucket* bucket)