mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
- Make startup a bit faster by changing some hash_update()'s and hash_add()'s
to hash_update_ptr()/hash_add_ptr()
This commit is contained in:
parent
920b7b2841
commit
bb302a755c
@ -217,7 +217,7 @@ ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength
|
||||
|
||||
h = ht->pHashFunction(arKey, nKeyLength);
|
||||
nIndex = h % ht->nTableSize;
|
||||
|
||||
|
||||
p = ht->arBuckets[nIndex];
|
||||
while (p != NULL) {
|
||||
if ((p->h == h) && (p->nKeyLength == nKeyLength)) {
|
||||
|
@ -89,6 +89,8 @@ ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength
|
||||
zend_hash_add_or_update(ht,arKey,nKeyLength,pData,nDataSize,pDest,HASH_ADD)
|
||||
#define zend_hash_update_ptr(ht,arKey,nKeyLength,pData,nDataSize,pDest) \
|
||||
zend_hash_add_or_update(ht,arKey,nKeyLength,pData,0,pDest,(HASH_UPDATE|HASH_ADD_PTR))
|
||||
#define zend_hash_add_ptr(ht,arKey,nKeyLength,pData,nDataSize,pDest) \
|
||||
zend_hash_add_or_update(ht,arKey,nKeyLength,pData,nDataSize,pDest,(HASH_ADD|HASH_ADD_PTR))
|
||||
|
||||
ZEND_API int zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest,int flag);
|
||||
#define zend_hash_quick_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest) \
|
||||
|
Loading…
Reference in New Issue
Block a user