summaryrefslogtreecommitdiff
path: root/Zend/zend_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_hash.c')
-rw-r--r--Zend/zend_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index 079069175b..3b01663945 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1109,7 +1109,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
IS_CONSISTENT(ht);
- if (ht->nNumOfElements <= 1) { /* Doesn't require sorting */
+ if (!(ht->nNumOfElements>1) && !(renumber && ht->nNumOfElements>0)) { /* Doesn't require sorting */
return SUCCESS;
}
arTmp = (Bucket **) pemalloc(ht->nNumOfElements * sizeof(Bucket *), ht->persistent);