提交 c3f83154 编写于 作者: F freemine

add first-place-check to benefit runtime performance

上级 7295cf43
...@@ -313,6 +313,11 @@ void *taosIterateRef(int rsetId, int64_t rid) { ...@@ -313,6 +313,11 @@ void *taosIterateRef(int rsetId, int64_t rid) {
// rid is there // rid is there
pNode = pNode->next; pNode = pNode->next;
// check first place
while (pNode) {
if (!pNode->removed) break;
pNode = pNode->next;
}
if (pNode == NULL) { if (pNode == NULL) {
taosUnlockList(pSet->lockedBy+hash); taosUnlockList(pSet->lockedBy+hash);
hash++; hash++;
...@@ -323,7 +328,14 @@ void *taosIterateRef(int rsetId, int64_t rid) { ...@@ -323,7 +328,14 @@ void *taosIterateRef(int rsetId, int64_t rid) {
for (; hash < pSet->max; ++hash) { for (; hash < pSet->max; ++hash) {
taosLockList(pSet->lockedBy+hash); taosLockList(pSet->lockedBy+hash);
pNode = pSet->nodeList[hash]; pNode = pSet->nodeList[hash];
if (pNode) break; if (pNode) {
// check first place
while (pNode) {
if (!pNode->removed) break;
pNode = pNode->next;
}
if (pNode) break;
}
taosUnlockList(pSet->lockedBy+hash); taosUnlockList(pSet->lockedBy+hash);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册