From: Frédéric Lécaille Date: Wed, 25 Apr 2018 13:13:38 +0000 (+0200) Subject: CLEANUP: cfgparse: Return asap from cfg_parse_peers(). X-Git-Tag: v2.0-dev1~192 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6617e769bfc58c8038e07f29325fde2ceb50a388;p=thirdparty%2Fhaproxy.git CLEANUP: cfgparse: Return asap from cfg_parse_peers(). Avoid useless code indentation. May be backported to 1.5 and newer. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index d4677efd57..54e5d92c02 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -643,7 +643,10 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) newpeer->sock_init_arg = NULL; HA_SPIN_INIT(&newpeer->lock); - if (strcmp(newpeer->id, localpeer) == 0) { + if (strcmp(newpeer->id, localpeer) != 0) + /* We are done. */ + goto out; + /* Current is local peer, it define a frontend */ newpeer->local = 1; cfg_peers->local = newpeer; @@ -687,7 +690,6 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) err_code |= ERR_FATAL; goto out; } - } } /* neither "peer" nor "peers" */ else if (!strcmp(args[0], "disabled")) { /* disables this peers section */ curpeers->state = PR_STSTOPPED;