summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-01-15 04:29:01 -0500
committerXinchen Hui <laruence@php.net>2015-01-15 04:29:01 -0500
commit11f615b3118f34dd8a118261d03c386d9dc0bbfd (patch)
tree34b95806c4fb45869b499d9fd02bdff778a1f4d6
parent2823c9dafbe4a86aa0d2d17e7c512bc26c3835f9 (diff)
downloadphp-git-11f615b3118f34dd8a118261d03c386d9dc0bbfd.tar.gz
We could do more....
-rw-r--r--ext/standard/array.c6
1 files changed, 5 insertions, 1 deletions
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);