Create a skiplist node with the specified number of levels. * The SDS string 'ele' is referenced by the node after the call. */
| 69 | /* Create a skiplist node with the specified number of levels. |
| 70 | * The SDS string 'ele' is referenced by the node after the call. */ |
| 71 | zskiplistNode *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. */ |
| 80 | zskiplist *zslCreate(void) { |