From 1adb6075fa26f20284b2427db501ce19b3ec0ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 18 Feb 2017 13:14:50 +0100 Subject: [PATCH] irc: compact some code --- src/plugins/irc/irc-command.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 1acd14952..831c2daba 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -322,10 +322,7 @@ irc_command_exec_all_channels (struct t_irc_server *server, if (ptr_channel->type == channel_type) { - if (inclusive) - picked = 0; - else - picked = 1; + picked = (inclusive) ? 0 : 1; if (channels) { @@ -334,10 +331,7 @@ irc_command_exec_all_channels (struct t_irc_server *server, if (weechat_string_match (ptr_channel->name, channels[i], 0)) { - if (inclusive) - picked = 1; - else - picked = 0; + picked = (inclusive) ? 1 : 0; break; } } @@ -554,10 +548,7 @@ irc_command_exec_all_servers (int inclusive, const char *str_servers, const char if (ptr_server->is_connected) { - if (inclusive) - picked = 0; - else - picked = 1; + picked = (inclusive) ? 0 : 1; if (servers) { @@ -566,10 +557,7 @@ irc_command_exec_all_servers (int inclusive, const char *str_servers, const char if (weechat_string_match (ptr_server->name, servers[i], 0)) { - if (inclusive) - picked = 1; - else - picked = 0; + picked = (inclusive) ? 1 : 0; break; } }