Skip to content

Commit cc89544

Browse files
committed
HashTable copying optimization (Matt Wilmas)
1 parent 41ae8de commit cc89544

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun
773773
p = source->pListHead;
774774
while (p) {
775775
if (p->nKeyLength) {
776-
zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &new_entry);
776+
zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &new_entry);
777777
} else {
778778
zend_hash_index_update(target, p->h, p->pData, size, &new_entry);
779779
}
@@ -798,7 +798,7 @@ ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_f
798798
p = source->pListHead;
799799
while (p) {
800800
if (p->nKeyLength>0) {
801-
if (_zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) {
801+
if (_zend_hash_quick_add_or_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) {
802802
pCopyConstructor(t);
803803
}
804804
} else {

0 commit comments

Comments
 (0)