MCPcopy Create free account
hub / github.com/F-Stack/f-stack / activeDefragZsetEntry

Function activeDefragZsetEntry

app/redis-6.2.6/src/defrag.c:241–254  ·  view source on GitHub ↗

Defrag helper for sorted set. * Defrag a single dict entry key name, and corresponding skiplist struct */

Source from the content-addressed store, hash-verified

239/* Defrag helper for sorted set.
240 * Defrag a single dict entry key name, and corresponding skiplist struct */
241long activeDefragZsetEntry(zset *zs, dictEntry *de) {
242 sds newsds;
243 double* newscore;
244 long defragged = 0;
245 sds sdsele = dictGetKey(de);
246 if ((newsds = activeDefragSds(sdsele)))
247 defragged++, de->key = newsds;
248 newscore = zslDefrag(zs->zsl, *(double*)dictGetVal(de), sdsele, newsds);
249 if (newscore) {
250 dictSetVal(zs->dict, de, newscore);
251 defragged++;
252 }
253 return defragged;
254}
255
256#define DEFRAG_SDS_DICT_NO_VAL 0
257#define DEFRAG_SDS_DICT_VAL_IS_SDS 1

Callers 2

scanLaterZsetCallbackFunction · 0.85
defragZsetSkiplistFunction · 0.85

Calls 2

activeDefragSdsFunction · 0.85
zslDefragFunction · 0.85

Tested by

no test coverage detected