From: Xinchen Hui Date: Thu, 15 Jan 2015 09:29:01 +0000 (-0500) Subject: We could do more.... X-Git-Tag: PRE_PHP7_REMOVALS~25^2~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11f615b3118f34dd8a118261d03c386d9dc0bbfd;p=php We could do more.... --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 471ba56aa2..0b50cf3cb0 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3229,6 +3229,9 @@ PHP_FUNCTION(array_unique) for (idx = 0; idx < i; idx++) { cmpdata = &arTmp[idx]; if (Z_TYPE(cmpdata->b.val) != IS_UNDEF) { +#if 1 + continue; +#else if (lastkept == NULL) { lastkept = cmpdata; continue; @@ -3244,13 +3247,14 @@ PHP_FUNCTION(array_unique) p = &cmpdata->b; } } +#endif } else { p = &cmpdata->b; } if (p->key == NULL) { zend_hash_index_del(Z_ARRVAL_P(return_value), p->h); } 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);