|
|
|
@ -522,7 +522,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht) |
|
|
|
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) |
|
|
|
{ |
|
|
|
uint nIndex; |
|
|
|
Bucket *p; |
|
|
|
Bucket *p, *t = NULL; /* initialize just to shut gcc up with -Wall */ |
|
|
|
|
|
|
|
IS_CONSISTENT(ht); |
|
|
|
|
|
|
|
@ -537,8 +537,10 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLen |
|
|
|
if ((p->h == h) && ((p->nKeyLength == 0) || /* Numeric index */ |
|
|
|
((p->nKeyLength == nKeyLength) && (!memcmp(p->arKey, arKey, nKeyLength))))) { |
|
|
|
HANDLE_BLOCK_INTERRUPTIONS(); |
|
|
|
if (ht->arBuckets[nIndex] == p) { |
|
|
|
if (p == ht->arBuckets[nIndex]) { |
|
|
|
ht->arBuckets[nIndex] = p->pNext; |
|
|
|
} else { |
|
|
|
t->pNext = p->pNext; |
|
|
|
} |
|
|
|
if (p->pListLast != NULL) { |
|
|
|
p->pListLast->pListNext = p->pListNext; |
|
|
|
@ -565,6 +567,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLen |
|
|
|
ht->nNumOfElements--; |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
t = p; |
|
|
|
p = p->pNext; |
|
|
|
} |
|
|
|
return FAILURE; |
|
|
|
|