summaryrefslogtreecommitdiff
path: root/src/t_set.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-11-30 09:41:54 +0100
committerantirez <antirez@gmail.com>2019-01-09 17:00:29 +0100
commit317f8b9d383f1b7f171aef7ea29f9e05abf0ba83 (patch)
tree28f4ca9efb35812f013ac459b18cc5e861591032 /src/t_set.c
parent1b7298e66ae002b9011c22d8270436506a9dc9b1 (diff)
downloadredis-317f8b9d383f1b7f171aef7ea29f9e05abf0ba83.tar.gz
RESP3: most null replies converted.
Diffstat (limited to 'src/t_set.c')
-rw-r--r--src/t_set.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/t_set.c b/src/t_set.c
index e78957d9b..61013dbcd 100644
--- a/src/t_set.c
+++ b/src/t_set.c
@@ -415,13 +415,13 @@ void spopWithCountCommand(client *c) {
/* Make sure a key with the name inputted exists, and that it's type is
* indeed a set. Otherwise, return nil */
- if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.emptymultibulk))
+ if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp]))
== NULL || checkType(c,set,OBJ_SET)) return;
/* If count is zero, serve an empty multibulk ASAP to avoid special
* cases later. */
if (count == 0) {
- addReply(c,shared.emptymultibulk);
+ addReplyNull(c);
return;
}
@@ -566,8 +566,8 @@ void spopCommand(client *c) {
/* Make sure a key with the name inputted exists, and that it's type is
* indeed a set */
- if ((set = lookupKeyWriteOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
- checkType(c,set,OBJ_SET)) return;
+ if ((set = lookupKeyWriteOrReply(c,c->argv[1],shared.null[c->resp]))
+ == NULL || checkType(c,set,OBJ_SET)) return;
/* Get a random element from the set */
encoding = setTypeRandomElement(set,&sdsele,&llele);
@@ -632,13 +632,13 @@ void srandmemberWithCountCommand(client *c) {
uniq = 0;
}
- if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.emptymultibulk))
+ if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp]))
== NULL || checkType(c,set,OBJ_SET)) return;
size = setTypeSize(set);
/* If count is zero, serve it ASAP to avoid special cases later. */
if (count == 0) {
- addReply(c,shared.emptymultibulk);
+ addReplyNull(c);
return;
}
@@ -760,8 +760,8 @@ void srandmemberCommand(client *c) {
return;
}
- if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
- checkType(c,set,OBJ_SET)) return;
+ if ((set = lookupKeyReadOrReply(c,c->argv[1],shared.null[c->resp]))
+ == NULL || checkType(c,set,OBJ_SET)) return;
encoding = setTypeRandomElement(set,&ele,&llele);
if (encoding == OBJ_ENCODING_INTSET) {
@@ -813,7 +813,7 @@ void sinterGenericCommand(client *c, robj **setkeys,
}
addReply(c,shared.czero);
} else {
- addReply(c,shared.emptymultibulk);
+ addReplyNull(c);
}
return;
}