1
0
Fork 0

fix pInternalPointer for xc_hash_copy_if

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1171 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2012-11-13 08:51:47 +00:00
parent 2f460a1052
commit f177b8e65f
1 changed files with 3 additions and 3 deletions

View File

@ -573,9 +573,6 @@ void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCop
p = source->pListHead;
while (p) {
if (checker(p->pData)) {
if (setTargetPointer && source->pInternalPointer == p) {
target->pInternalPointer = NULL;
}
if (p->nKeyLength) {
zend_u_hash_quick_update(target, p->key.type, ZSTR(BUCKET_KEY_S(p)), p->nKeyLength, p->h, p->pData, size, &new_entry);
} else {
@ -584,6 +581,9 @@ void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCop
if (pCopyConstructor) {
pCopyConstructor(new_entry);
}
if (setTargetPointer && source->pInternalPointer == p) {
target->pInternalPointer = new_entry;
}
}
p = p->pListNext;
}