Unverified Commit 6b44e4ea authored by Lu JJ's avatar Lu JJ Committed by GitHub
Browse files

fix some typos in "t_zset.c" (#10670)

fix some typo in "t_zset.c".
1. `zzlisinlexrange` the function name mentioned in the comment is misspelled.
2. fix typo in function name`zarndmemberReplyWithListpack` -> `zrandmemberReplyWithListpack`
parent 2bcd890d
...@@ -927,7 +927,7 @@ int zzlLexValueLteMax(unsigned char *p, zlexrangespec *spec) { ...@@ -927,7 +927,7 @@ int zzlLexValueLteMax(unsigned char *p, zlexrangespec *spec) {
} }
/* Returns if there is a part of the zset is in range. Should only be used /* Returns if there is a part of the zset is in range. Should only be used
* internally by zzlFirstInRange and zzlLastInRange. */ * internally by zzlFirstInLexRange and zzlLastInLexRange. */
int zzlIsInLexRange(unsigned char *zl, zlexrangespec *range) { int zzlIsInLexRange(unsigned char *zl, zlexrangespec *range) {
unsigned char *p; unsigned char *p;
...@@ -4054,7 +4054,7 @@ void bzpopmaxCommand(client *c) { ...@@ -4054,7 +4054,7 @@ void bzpopmaxCommand(client *c) {
blockingGenericZpopCommand(c, c->argv+1, c->argc-2, ZSET_MAX, c->argc-1, -1, 0, 0); blockingGenericZpopCommand(c, c->argv+1, c->argc-2, ZSET_MAX, c->argc-1, -1, 0, 0);
} }
static void zarndmemberReplyWithListpack(client *c, unsigned int count, listpackEntry *keys, listpackEntry *vals) { static void zrandmemberReplyWithListpack(client *c, unsigned int count, listpackEntry *keys, listpackEntry *vals) {
for (unsigned long i = 0; i < count; i++) { for (unsigned long i = 0; i < count; i++) {
if (vals && c->resp > 2) if (vals && c->resp > 2)
addReplyArrayLen(c,2); addReplyArrayLen(c,2);
...@@ -4135,7 +4135,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) { ...@@ -4135,7 +4135,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
sample_count = count > limit ? limit : count; sample_count = count > limit ? limit : count;
count -= sample_count; count -= sample_count;
lpRandomPairs(zsetobj->ptr, sample_count, keys, vals); lpRandomPairs(zsetobj->ptr, sample_count, keys, vals);
zarndmemberReplyWithListpack(c, sample_count, keys, vals); zrandmemberReplyWithListpack(c, sample_count, keys, vals);
} }
zfree(keys); zfree(keys);
zfree(vals); zfree(vals);
...@@ -4234,7 +4234,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) { ...@@ -4234,7 +4234,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
if (withscores) if (withscores)
vals = zmalloc(sizeof(listpackEntry)*count); vals = zmalloc(sizeof(listpackEntry)*count);
serverAssert(lpRandomPairsUnique(zsetobj->ptr, count, keys, vals) == count); serverAssert(lpRandomPairsUnique(zsetobj->ptr, count, keys, vals) == count);
zarndmemberReplyWithListpack(c, count, keys, vals); zrandmemberReplyWithListpack(c, count, keys, vals);
zfree(keys); zfree(keys);
zfree(vals); zfree(vals);
zuiClearIterator(&src); zuiClearIterator(&src);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment