Update `distinct()`.
This commit is contained in:
parent
43d19eeb9f
commit
1ce0386a2f
|
@ -898,7 +898,7 @@ PHP_METHOD(Collection, distinct)
|
||||||
zend_array* current = COLLECTION_FETCH_CURRENT();
|
zend_array* current = COLLECTION_FETCH_CURRENT();
|
||||||
compare_func_t cmp = NULL;
|
compare_func_t cmp = NULL;
|
||||||
equal_check_func_t eql = 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);
|
ARRAY_CLONE(distinct, current);
|
||||||
uint32_t idx = 0;
|
uint32_t idx = 0;
|
||||||
ZEND_HASH_FOREACH_BUCKET(distinct, Bucket* bucket)
|
ZEND_HASH_FOREACH_BUCKET(distinct, Bucket* bucket)
|
||||||
|
|
Reference in New Issue