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

Function RM_DictPrev

src/module.cpp:7051–7056  ·  view source on GitHub ↗

Like RedisModule_DictNext() but after returning the currently selected * element in the iterator, it selects the previous element (laxicographically * smaller) instead of the next one. */

Source from the content-addressed store, hash-verified

7049 * element in the iterator, it selects the previous element (laxicographically
7050 * smaller) instead of the next one. */
7051RedisModuleString *RM_DictPrev(RedisModuleCtx *ctx, RedisModuleDictIter *di, void **dataptr) {
7052 size_t keylen;
7053 void *key = RM_DictPrevC(di,&keylen,dataptr);
7054 if (key == NULL) return NULL;
7055 return RM_CreateString(ctx,(const char*)key,keylen);
7056}
7057
7058/* Compare the element currently pointed by the iterator to the specified
7059 * element given by key/keylen, according to the operator 'op' (the set of

Callers

nothing calls this directly

Calls 2

RM_DictPrevCFunction · 0.85
RM_CreateStringFunction · 0.85

Tested by

no test coverage detected