mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
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;
|
||||
|
||||
/* 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;
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user