RE: [PHP-DEV] usort won't work anymore on 408dev -> zend_hash.c b ug?
| From: | Marc Boeren | Date: | Thu, 04 Oct 2001 12:17:12 +0000 |
| Subject: | RE: [PHP-DEV] usort won't work anymore on 408dev -> zend_hash.c b ug? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67256@lists.php.net to get a copy of this message | ||
> So it seems the results are sorted, but the keys aren't reassigned...
If I track the source, I find the zend_hash_sort function in zend_hash.c has
changed between 407 and 408:
407:
if (renumber) {
p = ht->pListHead;
i=0;
while (p != NULL) {
p->nKeyLength = 0;
p->h = i++;
p = p->pListNext;
}
ht->nNextFreeElement = i;
zend_hash_rehash(ht);
}
408:
if (renumber) {
p = ht->pListHead;
i=0;
while (p != NULL) {
p->nKeyLength = 0;
;
p = p->pListNext;
}
ht->nNextFreeElement = i;
zend_hash_rehash(ht);
}
If I restore the
p->h = i++;
line, everything works again...
Cheerio, Marc.