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
c4ca5f99
"vscode:/vscode.git/clone" did not exist on "028fdbb70b05263fc13330f722a1236b2656718e"
Commit
c4ca5f99
authored
Oct 31, 2013
by
antirez
Browse files
Inverted variable boolean value and name after scanGenericCommand() refactoring.
parent
8fc85a12
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
c4ca5f99
...
@@ -370,7 +370,7 @@ void scanGenericCommand(redisClient *c, robj *o) {
...
@@ -370,7 +370,7 @@ void scanGenericCommand(redisClient *c, robj *o) {
unsigned
long
cursor
=
0
;
unsigned
long
cursor
=
0
;
long
count
=
10
;
long
count
=
10
;
sds
pat
;
sds
pat
;
int
patlen
,
patnoop
=
1
;
int
patlen
,
use_pattern
=
0
;
dict
*
ht
;
dict
*
ht
;
/* Object must be NULL (to iterate keys names), or the type of the object
/* Object must be NULL (to iterate keys names), or the type of the object
...
@@ -408,8 +408,9 @@ void scanGenericCommand(redisClient *c, robj *o) {
...
@@ -408,8 +408,9 @@ void scanGenericCommand(redisClient *c, robj *o) {
pat
=
c
->
argv
[
i
+
1
]
->
ptr
;
pat
=
c
->
argv
[
i
+
1
]
->
ptr
;
patlen
=
sdslen
(
pat
);
patlen
=
sdslen
(
pat
);
/* The pattern is a no-op iff == "*" */
/* The pattern always matches if it is exactly "*", so it is
patnoop
=
(
pat
[
0
]
==
'*'
&&
patlen
==
1
);
* equivalent to disabling it. */
use_pattern
=
!
(
pat
[
0
]
==
'*'
&&
patlen
==
1
);
i
+=
2
;
i
+=
2
;
}
else
{
}
else
{
...
@@ -483,7 +484,7 @@ void scanGenericCommand(redisClient *c, robj *o) {
...
@@ -483,7 +484,7 @@ void scanGenericCommand(redisClient *c, robj *o) {
int
filter
=
0
;
int
filter
=
0
;
/* Filter element if it does not match the pattern. */
/* Filter element if it does not match the pattern. */
if
(
!
filter
&&
!
patnoop
)
{
if
(
!
filter
&&
use_pattern
)
{
if
(
sdsEncodedObject
(
kobj
))
{
if
(
sdsEncodedObject
(
kobj
))
{
if
(
!
stringmatchlen
(
pat
,
patlen
,
kobj
->
ptr
,
sdslen
(
kobj
->
ptr
),
0
))
if
(
!
stringmatchlen
(
pat
,
patlen
,
kobj
->
ptr
,
sdslen
(
kobj
->
ptr
),
0
))
filter
=
1
;
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