mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
We could do more....
This commit is contained in:
parent
2823c9dafb
commit
11f615b311
1 changed files with 5 additions and 1 deletions
|
@ -3229,6 +3229,9 @@ PHP_FUNCTION(array_unique)
|
||||||
for (idx = 0; idx < i; idx++) {
|
for (idx = 0; idx < i; idx++) {
|
||||||
cmpdata = &arTmp[idx];
|
cmpdata = &arTmp[idx];
|
||||||
if (Z_TYPE(cmpdata->b.val) != IS_UNDEF) {
|
if (Z_TYPE(cmpdata->b.val) != IS_UNDEF) {
|
||||||
|
#if 1
|
||||||
|
continue;
|
||||||
|
#else
|
||||||
if (lastkept == NULL) {
|
if (lastkept == NULL) {
|
||||||
lastkept = cmpdata;
|
lastkept = cmpdata;
|
||||||
continue;
|
continue;
|
||||||
|
@ -3244,13 +3247,14 @@ PHP_FUNCTION(array_unique)
|
||||||
p = &cmpdata->b;
|
p = &cmpdata->b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
p = &cmpdata->b;
|
p = &cmpdata->b;
|
||||||
}
|
}
|
||||||
if (p->key == NULL) {
|
if (p->key == NULL) {
|
||||||
zend_hash_index_del(Z_ARRVAL_P(return_value), p->h);
|
zend_hash_index_del(Z_ARRVAL_P(return_value), p->h);
|
||||||
} else {
|
} else {
|
||||||
zend_hash_del(Z_ARRVAL_P(return_value), p->key);
|
zend_hash_del(Z_ARRVAL_P(return_value), p->key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pefree(arTmp, Z_ARRVAL_P(array)->u.flags & HASH_FLAG_PERSISTENT);
|
pefree(arTmp, Z_ARRVAL_P(array)->u.flags & HASH_FLAG_PERSISTENT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue