From: Andi Gutmans Date: Thu, 28 Sep 2000 23:21:08 +0000 (+0000) Subject: - Another has optimization/fix like the hash_copy one from earlier on X-Git-Tag: php-4.0.3RC1~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4fd954b8a3438502f6f4cf76a54fc3623255f5d;p=php - Another has optimization/fix like the hash_copy one from earlier on --- diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 280fc0b679..baca3bc17c 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -782,13 +782,12 @@ ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_fu p = source->pListHead; while (p) { - memcpy(tmp, p->pData, size); if (p->nKeyLength>0) { - if (zend_hash_add_or_update(target, p->arKey, p->nKeyLength, tmp, size, &t, mode)==SUCCESS && pCopyConstructor) { + if (zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode)==SUCCESS && pCopyConstructor) { pCopyConstructor(t); } } else { - if ((mode==HASH_UPDATE || !zend_hash_index_exists(target, p->h)) && zend_hash_index_update(target, p->h, tmp, size, &t)==SUCCESS && pCopyConstructor) { + if ((mode==HASH_UPDATE || !zend_hash_index_exists(target, p->h)) && zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { pCopyConstructor(t); } }