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

Function RM_DictNext

app/redis-6.2.6/src/module.c:6849–6854  ·  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

6847 * The returned string object should be deallocated after use, either manually
6848 * or by using a context that has automatic memory management active. */
6849RedisModuleString *RM_DictNext(RedisModuleCtx *ctx, RedisModuleDictIter *di, void **dataptr) {
6850 size_t keylen;
6851 void *key = RM_DictNextC(di,&keylen,dataptr);
6852 if (key == NULL) return NULL;
6853 return RM_CreateString(ctx,key,keylen);
6854}
6855
6856/* Like RedisModule_DictNext() but after returning the currently selected
6857 * 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