Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
83685507
Commit
83685507
authored
Aug 16, 2013
by
antirez
Browse files
Fix comments for correctness in zunionInterGenericCommand().
Related to issue #1240.
parent
3ad87c65
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
83685507
...
@@ -1639,7 +1639,7 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
...
@@ -1639,7 +1639,7 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
while (zuiNext(&src[i],&zval)) {
while (zuiNext(&src[i],&zval)) {
double score, value;
double score, value;
/* Skip
key
when already processed */
/* Skip
an element that
when already processed */
if (dictFind(dstzset->dict,zuiObjectFromValue(&zval)) != NULL)
if (dictFind(dstzset->dict,zuiObjectFromValue(&zval)) != NULL)
continue;
continue;
...
@@ -1647,8 +1647,10 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
...
@@ -1647,8 +1647,10 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
score = src[i].weight * zval.score;
score = src[i].weight * zval.score;
if (isnan(score)) score = 0;
if (isnan(score)) score = 0;
/* Because the inputs are sorted by size, it's only possible
/* We need to check only next sets to see if this element
* for sets at larger indices to hold 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++) {
for (j = (i+1); j < setnum; j++) {
/* It is not safe to access the zset we are
/* It is not safe to access the zset we are
* iterating, so explicitly check for equal object. */
* iterating, so explicitly check for equal object. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment