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

Function RM_ZsetRangeStop

app/redis-6.2.6/src/module.c:2750–2759  ·  view source on GitHub ↗

Stop a sorted set iteration. */

Source from the content-addressed store, hash-verified

2748
2749/* Stop a sorted set iteration. */
2750void RM_ZsetRangeStop(RedisModuleKey *key) {
2751 if (!key->value || key->value->type != OBJ_ZSET) return;
2752 /* Free resources if needed. */
2753 if (key->u.zset.type == REDISMODULE_ZSET_RANGE_LEX)
2754 zslFreeLexRange(&key->u.zset.lrs);
2755 /* Setup sensible values so that misused iteration API calls when an
2756 * iterator is not active will result into something more sensible
2757 * than crashing. */
2758 zsetKeyReset(key);
2759}
2760
2761/* Return the "End of range" flag value to signal the end of the iteration. */
2762int 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