Commit 71439a07 authored by Guy Benoish's avatar Guy Benoish Committed by antirez
Browse files

ZPOP should return an empty array if COUNT=0

parent c8a26834
...@@ -3141,7 +3141,10 @@ void genericZpopCommand(client *c, robj **keyv, int keyc, int where, int emitkey ...@@ -3141,7 +3141,10 @@ void genericZpopCommand(client *c, robj **keyv, int keyc, int where, int emitkey
if (countarg) { if (countarg) {
if (getLongFromObjectOrReply(c,countarg,&count,NULL) != C_OK) if (getLongFromObjectOrReply(c,countarg,&count,NULL) != C_OK)
return; return;
if (count < 0) count = 1; if (count <= 0) {
addReplyNullArray(c);
return;
}
} }
/* Check type and break on the first error, otherwise identify candidate. */ /* Check type and break on the first error, otherwise identify candidate. */
......
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