diff --git a/src/object.c b/src/object.c index 125c1a5952752a0b1f79ae6756b95cc1122ed0b1..90df9e38b3273d433a85135b367a3e7b02067ee4 100644 --- a/src/object.c +++ b/src/object.c @@ -246,11 +246,9 @@ void freeStringObject(robj *o) { } void freeListObject(robj *o) { - switch (o->encoding) { - case OBJ_ENCODING_QUICKLIST: + if (o->encoding == OBJ_ENCODING_QUICKLIST) { quicklistRelease(o->ptr); - break; - default: + } else { serverPanic("Unknown list encoding type"); } }