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
f5577fdb
Unverified
Commit
f5577fdb
authored
Jan 14, 2021
by
houzj.fnst
Committed by
GitHub
Jan 13, 2021
Browse files
remove some unnecessary checks (#7431)
Remove several checks that always evaluate to true.
parent
8a81ed1b
Changes
4
Show whitespace changes
Inline
Side-by-side
src/db.c
View file @
f5577fdb
...
...
@@ -951,7 +951,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long cursor) {
int
filter
=
0
;
/* Filter element if it does not match the pattern. */
if
(
!
filter
&&
use_pattern
)
{
if
(
use_pattern
)
{
if
(
sdsEncodedObject
(
kobj
))
{
if
(
!
stringmatchlen
(
pat
,
patlen
,
kobj
->
ptr
,
sdslen
(
kobj
->
ptr
),
0
))
filter
=
1
;
...
...
src/expire.c
View file @
f5577fdb
...
...
@@ -224,7 +224,7 @@ void activeExpireCycle(int type) {
/* When there are less than 1% filled slots, sampling the key
* space is expensive, so stop here waiting for better times...
* The dictionary will be resized asap. */
if
(
num
&&
slots
>
DICT_HT_INITIAL_SIZE
&&
if
(
slots
>
DICT_HT_INITIAL_SIZE
&&
(
num
*
100
/
slots
<
1
))
break
;
/* The main collection cycle. Sample random keys among keys
...
...
src/networking.c
View file @
f5577fdb
...
...
@@ -1707,7 +1707,7 @@ int processInlineBuffer(client *c) {
}
/* Handle the \r\n case. */
if
(
newline
&&
newline
!=
c
->
querybuf
+
c
->
qb_pos
&&
*
(
newline
-
1
)
==
'\r'
)
if
(
newline
!=
c
->
querybuf
+
c
->
qb_pos
&&
*
(
newline
-
1
)
==
'\r'
)
newline
--
,
linefeed_chars
++
;
/* Split the input buffer up to the \r\n */
...
...
src/redis-cli.c
View file @
f5577fdb
...
...
@@ -5301,7 +5301,7 @@ static clusterManagerNode *clusterNodeForResharding(char *id,
clusterManagerLogErr
(
invalid_node_msg
,
id
);
*
raise_err
=
1
;
return
NULL
;
}
else
if
(
node
!=
NULL
&&
target
!=
NULL
)
{
}
else
if
(
target
!=
NULL
)
{
if
(
!
strcmp
(
node
->
name
,
target
->
name
))
{
clusterManagerLogErr
(
"*** It is not possible to use "
"the target node as "
...
...
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