提交 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 ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册