com php-src: We could do more....: ext/standard/array.c
| From: | Xinchen Hui | Date: | Thu, 15 Jan 2015 09:29:01 +0000 |
| Subject: | com php-src: We could do more....: ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84103@lists.php.net to get a copy of this message | ||
Commit: 11f615b3118f34dd8a118261d03c386d9dc0bbfd
Author: Xinchen Hui <laruence@php.net> Thu, 15 Jan 2015 04:29:01 -0500
Parents: 2823c9dafbe4a86aa0d2d17e7c512bc26c3835f9
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=11f615b3118f34dd8a118261d03c386d9dc0bbfd
Log:
We could do more....
Changed paths:
M ext/standard/array.c
Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 471ba56..0b50cf3 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);