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

Function RM_DictNextC

src/module.cpp:7017–7022  ·  view source on GitHub ↗

Return the current item of the dictionary iterator `di` and steps to the * next element. If the iterator already yield the last element and there * are no other elements to return, NULL is returned, otherwise a pointer * to a string representing the key is provided, and the `*keylen` length * is set by reference (if keylen is not NULL). The `*dataptr`, if not NULL * is set to the value of the

Source from the content-addressed store, hash-verified

7015 * next/prev iterator step. Also the pointer is no longer valid once the
7016 * iterator is released. */
7017void *RM_DictNextC(RedisModuleDictIter *di, size_t *keylen, void **dataptr) {
7018 if (!raxNext(&di->ri)) return NULL;
7019 if (keylen) *keylen = di->ri.key_len;
7020 if (dataptr) *dataptr = di->ri.data;
7021 return di->ri.key;
7022}
7023
7024/* This function is exactly like RedisModule_DictNext() but after returning
7025 * the currently selected element in the iterator, it selects the previous

Callers 1

RM_DictNextFunction · 0.85

Calls 1

raxNextFunction · 0.85

Tested by

no test coverage detected