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.
This commit is contained in:
antirez 2014-12-10 11:11:44 +01:00
parent 0422321617
commit c83a917286

View File

@ -2796,10 +2796,8 @@ void sentinelCommand(redisClient *c) {
*/ */
dictType copy_keeper = instancesDictType; dictType copy_keeper = instancesDictType;
copy_keeper.valDestructor = NULL; copy_keeper.valDestructor = NULL;
dict *masters_local = NULL; dict *masters_local = sentinel.masters;
if (c->argc == 2) { if (c->argc > 2) {
masters_local = sentinel.masters;
} else {
masters_local = dictCreate(&copy_keeper, NULL); masters_local = dictCreate(&copy_keeper, NULL);
for (int i = 2; i < c->argc; i++) { for (int i = 2; i < c->argc; i++) {