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
f447a7eb
Commit
f447a7eb
authored
May 21, 2011
by
antirez
Browse files
ZUNIONSTORE new iterator API fix backported into 2.2
parent
748a2da3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
f447a7eb
...
@@ -735,12 +735,21 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
...
@@ -735,12 +735,21 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
/* because the zsets are sorted by size, its only possible
/* because the zsets are sorted by size, its only possible
* for sets at larger indices to hold this entry */
* for sets at larger indices to hold this entry */
for
(
j
=
(
i
+
1
);
j
<
setnum
;
j
++
)
{
for
(
j
=
(
i
+
1
);
j
<
setnum
;
j
++
)
{
dictEntry
*
other
=
dictFind
(
src
[
j
].
dict
,
dictGetEntryKey
(
de
));
/* It is not safe to access the zset we are
* iterating, so explicitly check for equal object. */
if
(
src
[
j
].
dict
==
src
[
i
].
dict
)
{
value
=
src
[
i
].
weight
*
zunionInterDictValue
(
de
);
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
}
else
{
dictEntry
*
other
;
other
=
dictFind
(
src
[
j
].
dict
,
dictGetEntryKey
(
de
));
if
(
other
)
{
if
(
other
)
{
value
=
src
[
j
].
weight
*
zunionInterDictValue
(
other
);
value
=
src
[
j
].
weight
*
zunionInterDictValue
(
other
);
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
}
}
}
}
}
robj
*
o
=
dictGetEntryKey
(
de
);
robj
*
o
=
dictGetEntryKey
(
de
);
znode
=
zslInsert
(
dstzset
->
zsl
,
score
,
o
);
znode
=
zslInsert
(
dstzset
->
zsl
,
score
,
o
);
...
...
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