fix: simple hash iterate remove and clear
This commit is contained in:
parent
4ee28bfc2c
commit
451e621a94
|
@ -295,11 +295,10 @@ int32_t tSimpleHashIterateRemove(SSHashObj *pHashObj, const void *key, size_t ke
|
|||
}
|
||||
|
||||
if (*pIter == (void *)GET_SHASH_NODE_DATA(pNode)) {
|
||||
if (pNode->next) {
|
||||
*pIter = GET_SHASH_NODE_DATA(pNode->next);
|
||||
} else {
|
||||
if (!pPrev) {
|
||||
*pIter = NULL;
|
||||
++(*iter);
|
||||
} else {
|
||||
*pIter = pPrev;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,6 +330,7 @@ void tSimpleHashClear(SSHashObj *pHashObj) {
|
|||
FREE_HASH_NODE(pNode);
|
||||
pNode = pNext;
|
||||
}
|
||||
pHashObj->hashList[i] = NULL;
|
||||
}
|
||||
atomic_store_64(&pHashObj->size, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue