Unverified Commit aeada201 authored by Chen Tianjie's avatar Chen Tianjie Committed by GitHub
Browse files

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.
parent 7b070423
...@@ -2024,10 +2024,11 @@ void zremrangeGenericCommand(client *c, zrange_type rangetype) { ...@@ -2024,10 +2024,11 @@ void zremrangeGenericCommand(client *c, zrange_type rangetype) {
break; break;
} }
dictResumeAutoResize(zs->dict); dictResumeAutoResize(zs->dict);
dictShrinkIfNeeded(zs->dict);
if (dictSize(zs->dict) == 0) { if (dictSize(zs->dict) == 0) {
dbDelete(c->db,key); dbDelete(c->db,key);
keyremoved = 1; keyremoved = 1;
} else {
dictShrinkIfNeeded(zs->dict);
} }
} else { } else {
serverPanic("Unknown sorted set encoding"); serverPanic("Unknown sorted set encoding");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment