]> git.saurik.com Git - redis.git/blobdiff - src/t_zset.c
A few no longer used defines removed from redis.h
[redis.git] / src / t_zset.c
index 7008f0c4aec93b7ac581f89779af928707c67d7a..f42e5a3185bcf7b44f147c5b0871e7457099703a 100644 (file)
@@ -1545,6 +1545,8 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
                 double score, value;
 
                 score = src[0].weight * zval.score;
+                if (isnan(score)) score = 0;
+
                 for (j = 1; j < setnum; j++) {
                     /* It is not safe to access the zset we are
                      * iterating, so explicitly check for equal object. */
@@ -1587,6 +1589,7 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
 
                 /* Initialize score */
                 score = src[i].weight * zval.score;
+                if (isnan(score)) score = 0;
 
                 /* Because the inputs are sorted by size, it's only possible
                  * for sets at larger indices to hold this element. */