mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
rename zslDeleteRange to zslDeleteRangeByScore (to differentiate between deleting using score or rank)
This commit is contained in:
parent
2424490f9b
commit
f84d393374
4
redis.c
4
redis.c
@ -5008,7 +5008,7 @@ static int zslDelete(zskiplist *zsl, double score, robj *obj) {
|
|||||||
* Min and mx are inclusive, so a score >= min || score <= max is deleted.
|
* Min and mx are inclusive, so a score >= min || score <= max is deleted.
|
||||||
* Note that this function takes the reference to the hash table view of the
|
* Note that this function takes the reference to the hash table view of the
|
||||||
* sorted set, in order to remove the elements from the hash table too. */
|
* sorted set, in order to remove the elements from the hash table too. */
|
||||||
static unsigned long zslDeleteRange(zskiplist *zsl, double min, double max, dict *dict) {
|
static unsigned long zslDeleteRangeByScore(zskiplist *zsl, double min, double max, dict *dict) {
|
||||||
zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
|
zskiplistNode *update[ZSKIPLIST_MAXLEVEL], *x;
|
||||||
unsigned long removed = 0;
|
unsigned long removed = 0;
|
||||||
int i;
|
int i;
|
||||||
@ -5317,7 +5317,7 @@ static void zremrangebyscoreCommand(redisClient *c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
zs = zsetobj->ptr;
|
zs = zsetobj->ptr;
|
||||||
deleted = zslDeleteRange(zs->zsl,min,max,zs->dict);
|
deleted = zslDeleteRangeByScore(zs->zsl,min,max,zs->dict);
|
||||||
if (htNeedsResize(zs->dict)) dictResize(zs->dict);
|
if (htNeedsResize(zs->dict)) dictResize(zs->dict);
|
||||||
server.dirty += deleted;
|
server.dirty += deleted;
|
||||||
addReplySds(c,sdscatprintf(sdsempty(),":%lu\r\n",deleted));
|
addReplySds(c,sdscatprintf(sdsempty(),":%lu\r\n",deleted));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user