From 3f2975ad1271ef19da23fc6e270a36dd128cd2bf Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 10 Dec 2014 11:11:44 +0100 Subject: [PATCH] Sentinel: INFO-CACHE GCC minior code cleanup. I guess the initial goal of the initialization was to suppress GCC warning, but if we have to initialize, we can do it with the base-case value instead of NULL which is never retained. --- src/sentinel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sentinel.c b/src/sentinel.c index 1308cd875..aec81441b 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2796,10 +2796,8 @@ void sentinelCommand(redisClient *c) { */ dictType copy_keeper = instancesDictType; copy_keeper.valDestructor = NULL; - dict *masters_local = NULL; - if (c->argc == 2) { - masters_local = sentinel.masters; - } else { + dict *masters_local = sentinel.masters; + if (c->argc > 2) { masters_local = dictCreate(©_keeper, NULL); for (int i = 2; i < c->argc; i++) {