| 1159 | *----------------------------------------------------------------------------*/ |
| 1160 | |
| 1161 | unsigned 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 | |
| 1173 | void zsetConvert(robj *zobj, int encoding) { |
| 1174 | zset *zs; |
no test coverage detected