提交 4ee28bfc 编写于 作者: C Cary Xu

fix: only iterate next when delete the specified node

上级 5dcfa5a2
......@@ -294,11 +294,13 @@ int32_t tSimpleHashIterateRemove(SSHashObj *pHashObj, const void *key, size_t ke
pPrev->next = pNode->next;
}
if (pNode->next) {
*pIter = GET_SHASH_NODE_DATA(pNode->next);
} else {
*pIter = NULL;
++(*iter);
if (*pIter == (void*)GET_SHASH_NODE_DATA(pNode)) {
if (pNode->next) {
*pIter = GET_SHASH_NODE_DATA(pNode->next);
} else {
*pIter = NULL;
++(*iter);
}
}
FREE_HASH_NODE(pNode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册