mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
fix zslGetRank bug in dead-code (#9246)
This fixes an issue with zslGetRank which will happen only if the skiplist data stracture is added two entries with the same element name, this can't happen in redis zsets (we use dict), but in theory this is a bug in the underlaying skiplist code. Fixes #3081 and #4032 Co-authored-by: minjian.cai <cmjgithub@163.com>
This commit is contained in:
parent
71d452876e
commit
9ca5e8c547
@ -488,7 +488,7 @@ unsigned long zslGetRank(zskiplist *zsl, double score, sds ele) {
|
||||
}
|
||||
|
||||
/* x might be equal to zsl->header, so test if obj is non-NULL */
|
||||
if (x->ele && sdscmp(x->ele,ele) == 0) {
|
||||
if (x->ele && x->score == score && sdscmp(x->ele,ele) == 0) {
|
||||
return rank;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user