diff --git a/src/db.c b/src/db.c index 5d63566a7..13126988f 100644 --- a/src/db.c +++ b/src/db.c @@ -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; diff --git a/src/expire.c b/src/expire.c index 275a735a7..d2945524c 100644 --- a/src/expire.c +++ b/src/expire.c @@ -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 diff --git a/src/networking.c b/src/networking.c index e624dd8f9..f1c606236 100644 --- a/src/networking.c +++ b/src/networking.c @@ -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 */ diff --git a/src/redis-cli.c b/src/redis-cli.c index 31d2360c9..2e8984c71 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -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 "