uphold the smove contract to return 0 when the element is not a member of the source set, even if source=dest

This commit is contained in:
Glenn Nethercutt
2015-04-17 09:27:54 -04:00
committed by antirez
parent bea224308b
commit 19382c8be6
2 changed files with 5 additions and 1 deletions

View File

@ -321,7 +321,10 @@ void smoveCommand(redisClient *c) {
/* If srcset and dstset are equal, SMOVE is a no-op */
if (srcset == dstset) {
addReply(c,shared.cone);
if (setTypeIsMember(srcset,ele))
addReply(c,shared.cone);
else
addReply(c,shared.czero);
return;
}