]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: ipc-client: Cleanup - avoid extra return in the function
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 5 Jul 2018 11:41:38 +0000 (14:41 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 25 Jan 2019 10:47:18 +0000 (12:47 +0200)
Simplifies the following commit.

src/lib-master/ipc-client.c

index 368cfd2e4d240a240c1c27caa151e605312e1008..09d8b51bba5046209b9e630c9915f81eb3abef70 100644 (file)
@@ -178,12 +178,11 @@ void ipc_client_cmd(struct ipc_client *client, const char *cmd,
                        client->to_failed = timeout_add_short(0,
                                ipc_client_cmd_connect_failed, client);
                }
-               return;
+       } else {
+               iov[0].iov_base = cmd;
+               iov[0].iov_len = strlen(cmd);
+               iov[1].iov_base = "\n";
+               iov[1].iov_len = 1;
+               o_stream_nsendv(client->output, iov, N_ELEMENTS(iov));
        }
-
-       iov[0].iov_base = cmd;
-       iov[0].iov_len = strlen(cmd);
-       iov[1].iov_base = "\n";
-       iov[1].iov_len = 1;
-       o_stream_nsendv(client->output, iov, N_ELEMENTS(iov));
 }