MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / zsetLength

Function zsetLength

src/t_zset.cpp:1161–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1159 *----------------------------------------------------------------------------*/
1160
1161unsigned long zsetLength(robj_roptr zobj) {
1162 unsigned long length = 0;
1163 if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
1164 length = zzlLength((const unsigned char*)zobj->m_ptr);
1165 } else if (zobj->encoding == OBJ_ENCODING_SKIPLIST) {
1166 length = ((const zset*)zobj->m_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
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