]> granicus.if.org Git - php/commitdiff
We could do more....
authorXinchen Hui <laruence@php.net>
Thu, 15 Jan 2015 09:29:01 +0000 (04:29 -0500)
committerXinchen Hui <laruence@php.net>
Thu, 15 Jan 2015 09:29:01 +0000 (04:29 -0500)
ext/standard/array.c

index 471ba56aa2a6696ef9bd3aa1dd5c6e9e4fe4f639..0b50cf3cb02d45e9b5d6344ace2b6984312cddc4 100644 (file)
@@ -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);