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
f1321349
Unverified
Commit
f1321349
authored
May 22, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
May 22, 2018
Browse files
Merge pull request #4935 from soloestoy/bugfix-zpop
bugfix for ZPOP: fix the wrong keyc, should be 1
parents
3c968ff0
4e7a160b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
f1321349
...
@@ -3080,8 +3080,8 @@ void zscanCommand(client *c) {
...
@@ -3080,8 +3080,8 @@ void zscanCommand(client *c) {
* use the 'count' argument to return multiple items if available. */
* use the 'count' argument to return multiple items if available. */
void
genericZpopCommand
(
client
*
c
,
robj
**
keyv
,
int
keyc
,
int
where
,
int
emitkey
,
robj
*
countarg
)
{
void
genericZpopCommand
(
client
*
c
,
robj
**
keyv
,
int
keyc
,
int
where
,
int
emitkey
,
robj
*
countarg
)
{
int
idx
;
int
idx
;
robj
*
key
;
robj
*
key
=
NULL
;
robj
*
zobj
;
robj
*
zobj
=
NULL
;
sds
ele
;
sds
ele
;
double
score
;
double
score
;
long
count
=
1
;
long
count
=
1
;
...
@@ -3185,7 +3185,7 @@ void zpopminCommand(client *c) {
...
@@ -3185,7 +3185,7 @@ void zpopminCommand(client *c) {
addReply
(
c
,
shared
.
syntaxerr
);
addReply
(
c
,
shared
.
syntaxerr
);
return
;
return
;
}
}
genericZpopCommand
(
c
,
&
c
->
argv
[
1
],
c
->
argc
-
1
,
ZSET_MIN
,
0
,
genericZpopCommand
(
c
,
&
c
->
argv
[
1
],
1
,
ZSET_MIN
,
0
,
c
->
argc
==
3
?
c
->
argv
[
2
]
:
NULL
);
c
->
argc
==
3
?
c
->
argv
[
2
]
:
NULL
);
}
}
...
@@ -3195,7 +3195,7 @@ void zpopmaxCommand(client *c) {
...
@@ -3195,7 +3195,7 @@ void zpopmaxCommand(client *c) {
addReply
(
c
,
shared
.
syntaxerr
);
addReply
(
c
,
shared
.
syntaxerr
);
return
;
return
;
}
}
genericZpopCommand
(
c
,
&
c
->
argv
[
1
],
c
->
argc
-
1
,
ZSET_MAX
,
0
,
genericZpopCommand
(
c
,
&
c
->
argv
[
1
],
1
,
ZSET_MAX
,
0
,
c
->
argc
==
3
?
c
->
argv
[
2
]
:
NULL
);
c
->
argc
==
3
?
c
->
argv
[
2
]
:
NULL
);
}
}
...
...
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