]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Nov 2018 11:09:56 +0000 (13:09 +0200)
Simplifies the following commit.

src/lib-master/ipc-client.c

index fa76a1ad7c5d6cd3a530da499cd31acee01ec39b..28d7217cafed4e98be3ef8b3af4c781fed8eebf4 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));
 }