]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: cfgparse: Return asap from cfg_parse_peers().
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 25 Apr 2018 13:13:38 +0000 (15:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Jan 2019 13:26:21 +0000 (14:26 +0100)
Avoid useless code indentation.

May be backported to 1.5 and newer.

src/cfgparse.c

index d4677efd577a636e7e4375f8d55efe14292f3eaf..54e5d92c02307905ec0dc93a549efe68d20134a9 100644 (file)
@@ -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;