X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/6eaad66373982aa9c1c0ff6b584c542670548d0e..0b10e1044496699585b401196dd86e19a9f87cc4:/src/object.c diff --git a/src/object.c b/src/object.c index e6b02da8..a6bf8a20 100644 --- a/src/object.c +++ b/src/object.c @@ -93,12 +93,18 @@ robj *createHashObject(void) { robj *createZsetObject(void) { zset *zs = zmalloc(sizeof(*zs)); - zs->dict = dictCreate(&zsetDictType,NULL); zs->zsl = zslCreate(); return createObject(REDIS_ZSET,zs); } +robj *createZsetZiplistObject(void) { + unsigned char *zl = ziplistNew(); + robj *o = createObject(REDIS_ZSET,zl); + o->encoding = REDIS_ENCODING_ZIPLIST; + return o; +} + void freeStringObject(robj *o) { if (o->encoding == REDIS_ENCODING_RAW) { sdsfree(o->ptr);