diff --git a/src/object.c b/src/object.c index 125c1a59..90df9e38 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"); } }