Avoid unnecessary dict shrink in zremrangeGenericCommand (#13143)
If the skiplist is emptied, there is no need to shrink the dict in skiplist, it can be deleted directly.
This commit is contained in:
parent
7b070423b8
commit
aeada20140
@ -2024,10 +2024,11 @@ void zremrangeGenericCommand(client *c, zrange_type rangetype) {
|
||||
break;
|
||||
}
|
||||
dictResumeAutoResize(zs->dict);
|
||||
dictShrinkIfNeeded(zs->dict);
|
||||
if (dictSize(zs->dict) == 0) {
|
||||
dbDelete(c->db,key);
|
||||
keyremoved = 1;
|
||||
} else {
|
||||
dictShrinkIfNeeded(zs->dict);
|
||||
}
|
||||
} else {
|
||||
serverPanic("Unknown sorted set encoding");
|
||||
|
Loading…
x
Reference in New Issue
Block a user