Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
参考源码: 循环中比较时,实际比的是当前节点的forward指针对应的节点的score和ele ``` for (i = zsl->level-1; i >= 0; i--) { /* store rank that is crossed to reach the insert position */ rank[i] = i == (zsl->level-1) ? 0 : rank[i+1]; while (x->level[i].forward && (x->level[i].forward->score < score || (x->level[i].forward->score == score && sdscmp(x->level[i].forward->ele,ele) < 0))) { x = x->level[i].forward; } update[i] = x; } ```
- Loading branch information