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

Function zslCreateNode

src/t_zset.cpp:71–77  ·  view source on GitHub ↗

Create a skiplist node with the specified number of levels. * The SDS string 'ele' is referenced by the node after the call. */

Source from the content-addressed store, hash-verified

69/* Create a skiplist node with the specified number of levels.
70 * The SDS string 'ele' is referenced by the node after the call. */
71zskiplistNode *zslCreateNode(int level, double score, sds ele) {
72 zskiplistNode *zn = (zskiplistNode*)
73 zmalloc(sizeof(*zn)+level*sizeof(struct zskiplistLevel), MALLOC_SHARED);
74 zn->score = score;
75 zn->ele = ele;
76 return zn;
77}
78
79/* Create a new skiplist. */
80zskiplist *zslCreate(void) {

Callers 2

zslCreateFunction · 0.85
zslInsertFunction · 0.85

Calls 1

zmallocFunction · 0.85

Tested by

no test coverage detected