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
59b30b32
Commit
59b30b32
authored
Oct 31, 2013
by
antirez
Browse files
SCAN: no sdsEncodedObject() API in Redis 2.8.
parent
3d3e350b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
59b30b32
...
...
@@ -475,16 +475,16 @@ void scanGenericCommand(redisClient *c, robj *o) {
/* Filter element if it does not match the pattern. */
if
(
!
filter
&&
use_pattern
)
{
if
(
sdsEncodedObject
(
kobj
))
{
if
(
!
stringmatchlen
(
pat
,
patlen
,
kobj
->
ptr
,
sdslen
(
kobj
->
ptr
),
0
))
filter
=
1
;
}
else
{
if
(
kobj
->
encoding
==
REDIS_ENCODING_INT
)
{
char
buf
[
REDIS_LONGSTR_SIZE
];
int
len
;
redisAssert
(
kobj
->
encoding
==
REDIS_ENCODING_INT
);
len
=
ll2string
(
buf
,
sizeof
(
buf
),(
long
)
kobj
->
ptr
);
if
(
!
stringmatchlen
(
pat
,
patlen
,
buf
,
len
,
0
))
filter
=
1
;
}
else
{
if
(
!
stringmatchlen
(
pat
,
patlen
,
kobj
->
ptr
,
sdslen
(
kobj
->
ptr
),
0
))
filter
=
1
;
}
}
...
...
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