Browse Source

fix pInternalPointer for xc_hash_copy_if

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1171 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 9 years ago
parent
commit
f177b8e65f
  1. 6
      xcache/xc_utils.c

6
xcache/xc_utils.c

@ -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;
}

Loading…
Cancel
Save