Skip to content

Commit

Permalink
Fix comments for correctness in zunionInterGenericCommand().
Browse files Browse the repository at this point in the history
Related to issue redis#1240.
  • Loading branch information
antirez committed Aug 19, 2013
1 parent cfb9d02 commit 3039e80
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/t_zset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,16 +1640,18 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
while (zuiNext(&src[i],&zval)) {
double score, value;

/* Skip key when already processed */
/* Skip an element that when already processed */
if (dictFind(dstzset->dict,zuiObjectFromValue(&zval)) != NULL)
continue;

/* 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. */
/* We need to check only next sets to see if this element
* exists, since we process every element just one time so
* it can't exist in a previous set (otherwise it would be
* already processed). */
for (j = (i+1); j < setnum; j++) {
/* It is not safe to access the zset we are
* iterating, so explicitly check for equal object. */
Expand Down

0 comments on commit 3039e80

Please sign in to comment.