3 ms·
Yes, that is correct. The code checks the encoding at runtime ( https://github.com/antirez/redis/blob/8444b46d20ef9c8de3f7e255e4f3bfa44f509c77/src/t_zset.c#L110
by catwell 10y ago
Yes, that is correct. The code checks the encoding at runtime ( https://github.com/antirez/redis/blob/8444b46d20ef9c8de3f7e255e4f3bfa44f509c77/src/t_zset.c#L1103-L1113 https://github.com/antirez/redis/blob/8444b46d20ef9c8de3f7e2... ) and converts between the structures as needed (see calls to `zsetConvert`). The alternative (for large zsets) is called zskiplist, the manipulation code is directly in t_zset.c and the structure is defined at https://github.com/antirez/redis/blob/8444b46d20ef9c8de3f7e255e4f3bfa44f509c77/src/server.h#L731-L746 https://github.com/antirez/redis/blob/8444b46d20ef9c8de3f7e2...