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

Function RM_ZsetRangeStop

src/module.cpp:2838–2847  ·  view source on GitHub ↗

Stop a sorted set iteration. */

Source from the content-addressed store, hash-verified

2836
2837/* Stop a sorted set iteration. */
2838void RM_ZsetRangeStop(RedisModuleKey *key) {
2839 if (!key->value || key->value->type != OBJ_ZSET) return;
2840 /* Free resources if needed. */
2841 if (key->u.zset.type == REDISMODULE_ZSET_RANGE_LEX)
2842 zslFreeLexRange(&key->u.zset.lrs);
2843 /* Setup sensible values so that misused iteration API calls when an
2844 * iterator is not active will result into something more sensible
2845 * than crashing. */
2846 zsetKeyReset(key);
2847}
2848
2849/* Return the "End of range" flag value to signal the end of the iteration. */
2850int RM_ZsetRangeEndReached(RedisModuleKey *key) {

Callers 3

moduleCloseKeyFunction · 0.85
zsetInitScoreRangeFunction · 0.85
zsetInitLexRangeFunction · 0.85

Calls 2

zslFreeLexRangeFunction · 0.85
zsetKeyResetFunction · 0.85

Tested by

no test coverage detected