fix: only iterate next when delete the specified node
This commit is contained in:
parent
5dcfa5a241
commit
4ee28bfc2c
|
@ -294,11 +294,13 @@ int32_t tSimpleHashIterateRemove(SSHashObj *pHashObj, const void *key, size_t ke
|
||||||
pPrev->next = pNode->next;
|
pPrev->next = pNode->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pNode->next) {
|
if (*pIter == (void*)GET_SHASH_NODE_DATA(pNode)) {
|
||||||
*pIter = GET_SHASH_NODE_DATA(pNode->next);
|
if (pNode->next) {
|
||||||
} else {
|
*pIter = GET_SHASH_NODE_DATA(pNode->next);
|
||||||
*pIter = NULL;
|
} else {
|
||||||
++(*iter);
|
*pIter = NULL;
|
||||||
|
++(*iter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_HASH_NODE(pNode);
|
FREE_HASH_NODE(pNode);
|
||||||
|
|
Loading…
Reference in New Issue