From ff615a066c41cf2ed2990048fc044181710cf166 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 21 May 2022 16:56:27 +0800 Subject: [PATCH] refactor: add assert in hash. --- source/util/src/thash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/util/src/thash.c b/source/util/src/thash.c index 8ae0a33f0f..89fc446da9 100644 --- a/source/util/src/thash.c +++ b/source/util/src/thash.c @@ -774,8 +774,11 @@ static void *taosHashReleaseNode(SHashObj *pHashObj, void *p, int *slot) { if (pOld->refCount <=0) { if (prevNode) { prevNode->next = pOld->next; + ASSERT(prevNode->next != prevNode); } else { pe->next = pOld->next; + SHashNode* x = pe->next; + ASSERT(x->next != x); } pe->num--;