MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zsetLength

Function zsetLength

app/redis-6.2.6/src/t_zset.c:1161–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1159 *----------------------------------------------------------------------------*/
1160
1161unsigned long zsetLength(const robj *zobj) {
1162 unsigned long length = 0;
1163 if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
1164 length = zzlLength(zobj->ptr);
1165 } else if (zobj->encoding == OBJ_ENCODING_SKIPLIST) {
1166 length = ((const zset*)zobj->ptr)->zsl->length;
1167 } else {
1168 serverPanic("Unknown sorted set encoding");
1169 }
1170 return length;
1171}
1172
1173void zsetConvert(robj *zobj, int encoding) {
1174 zset *zs;

Callers 15

rdbLoadObjectFunction · 0.85
rewriteSortedSetObjectFunction · 0.85
zsetRankFunction · 0.85
zsetDupFunction · 0.85
zremCommandFunction · 0.85
zremrangeGenericCommandFunction · 0.85
zcardCommandFunction · 0.85
genericZpopCommandFunction · 0.85

Calls 1

zzlLengthFunction · 0.85

Tested by

no test coverage detected