Why the skiplist is defined in the server.h?
I read the src and found the zskiplist and the zset data structures are defined in the server.h. I think it is a little bit strange.
Why is it designed this way? and whether it to be considered refactoring?
Comment From: sundb
@TOMsworkspace This may be related to its earliest implementation(6b47e12), which was strongly coupled to robj when it was implemented, so it's not really a standalone library. It does look like it could be moved to a separate file now, but I don't think we should make such a big change just to move the codes, and it would also break a lot of blame logs.
Comment From: oranagra
maybe it's also related to the fact that in redis 3.0 the cluster's slots_to_keys used to use a skiplist (changed to rax in 4.0)
p.s. many things in redis take the approach of one header (server.h) serving multiple source files. thinks that have their own header are usually ones that are completely independent libraries, like listpack, rax, dict. so maybe skiplist could have been one, but i don't think we wanna bother splitting it now, maybe when we some day have some big project around that code.