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

Function RM_DictPrevC

src/module.cpp:7027–7032  ·  view source on GitHub ↗

This function is exactly 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

7025 * the currently selected element in the iterator, it selects the previous
7026 * element (laxicographically smaller) instead of the next one. */
7027void *RM_DictPrevC(RedisModuleDictIter *di, size_t *keylen, void **dataptr) {
7028 if (!raxPrev(&di->ri)) return NULL;
7029 if (keylen) *keylen = di->ri.key_len;
7030 if (dataptr) *dataptr = di->ri.data;
7031 return di->ri.key;
7032}
7033
7034/* Like RedisModuleNextC(), but instead of returning an internally allocated
7035 * buffer and key length, it returns directly a module string object allocated

Callers 1

RM_DictPrevFunction · 0.85

Calls 1

raxPrevFunction · 0.85

Tested by

no test coverage detected