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

Function RM_DictNext

src/module.cpp:7041–7046  ·  view source on GitHub ↗

Like RedisModuleNextC(), but instead of returning an internally allocated * buffer and key length, it returns directly a module string object allocated * in the specified context 'ctx' (that may be NULL exactly like for the main * API RedisModule_CreateString). * * The returned string object should be deallocated after use, either manually * or by using a context that has automatic memory ma

Source from the content-addressed store, hash-verified

7039 * The returned string object should be deallocated after use, either manually
7040 * or by using a context that has automatic memory management active. */
7041RedisModuleString *RM_DictNext(RedisModuleCtx *ctx, RedisModuleDictIter *di, void **dataptr) {
7042 size_t keylen;
7043 void *key = RM_DictNextC(di,&keylen,dataptr);
7044 if (key == NULL) return NULL;
7045 return RM_CreateString(ctx,(const char*)key,keylen);
7046}
7047
7048/* Like RedisModule_DictNext() but after returning the currently selected
7049 * element in the iterator, it selects the previous element (laxicographically

Callers

nothing calls this directly

Calls 2

RM_DictNextCFunction · 0.85
RM_CreateStringFunction · 0.85

Tested by

no test coverage detected