remove some unnecessary checks (#7431)

Remove several checks that always evaluate to true.
This commit is contained in:
houzj.fnst 2021-01-14 04:00:55 +08:00 committed by GitHub
parent 8a81ed1b5a
commit f5577fdbd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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

View File

@ -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 */

View File

@ -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 "