remove some unnecessary checks (#7431)
Remove several checks that always evaluate to true.
This commit is contained in:
parent
8a81ed1b5a
commit
f5577fdbd8
2
src/db.c
2
src/db.c
@ -951,7 +951,7 @@ void scanGenericCommand(client *c, robj *o, unsigned long cursor) {
|
|||||||
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 && use_pattern) {
|
if (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;
|
||||||
|
@ -224,7 +224,7 @@ void activeExpireCycle(int type) {
|
|||||||
/* When there are less than 1% filled slots, sampling the key
|
/* When there are less than 1% filled slots, sampling the key
|
||||||
* space is expensive, so stop here waiting for better times...
|
* space is expensive, so stop here waiting for better times...
|
||||||
* The dictionary will be resized asap. */
|
* The dictionary will be resized asap. */
|
||||||
if (num && slots > DICT_HT_INITIAL_SIZE &&
|
if (slots > DICT_HT_INITIAL_SIZE &&
|
||||||
(num*100/slots < 1)) break;
|
(num*100/slots < 1)) break;
|
||||||
|
|
||||||
/* The main collection cycle. Sample random keys among keys
|
/* The main collection cycle. Sample random keys among keys
|
||||||
|
@ -1707,7 +1707,7 @@ int processInlineBuffer(client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle the \r\n case. */
|
/* 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++;
|
newline--, linefeed_chars++;
|
||||||
|
|
||||||
/* Split the input buffer up to the \r\n */
|
/* Split the input buffer up to the \r\n */
|
||||||
|
@ -5301,7 +5301,7 @@ static clusterManagerNode *clusterNodeForResharding(char *id,
|
|||||||
clusterManagerLogErr(invalid_node_msg, id);
|
clusterManagerLogErr(invalid_node_msg, id);
|
||||||
*raise_err = 1;
|
*raise_err = 1;
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (node != NULL && target != NULL) {
|
} else if (target != NULL) {
|
||||||
if (!strcmp(node->name, target->name)) {
|
if (!strcmp(node->name, target->name)) {
|
||||||
clusterManagerLogErr( "*** It is not possible to use "
|
clusterManagerLogErr( "*** It is not possible to use "
|
||||||
"the target node as "
|
"the target node as "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user