]> granicus.if.org Git - php/commitdiff
MFZE1
authorZeev Suraski <zeev@php.net>
Sat, 17 Aug 2002 16:07:26 +0000 (16:07 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 17 Aug 2002 16:07:26 +0000 (16:07 +0000)
Zend/zend_hash.c

index 079069175bc83e120386908f22631e0fd58c467d..3b016639452cf56396a84c0829fcd4824c7b815c 100644 (file)
@@ -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);