red-client: Minor simplification for red_client_get_channel

Remove "ret" variable and just return the value

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Rope <jrope@redhat.com>
This commit is contained in:
Frediano Ziglio 2020-02-07 12:50:23 +00:00
parent 1ce119009a
commit 9bc0aa76f6

View File

@ -247,7 +247,6 @@ void red_client_destroy(RedClient *client)
static RedChannelClient *red_client_get_channel(RedClient *client, int type, int id)
{
RedChannelClient *rcc;
RedChannelClient *ret = NULL;
FOREACH_CHANNEL_CLIENT(client, rcc) {
int channel_type, channel_id;
@ -256,11 +255,10 @@ static RedChannelClient *red_client_get_channel(RedClient *client, int type, int
channel = red_channel_client_get_channel(rcc);
g_object_get(channel, "channel-type", &channel_type, "id", &channel_id, NULL);
if (channel_type == type && channel_id == id) {
ret = rcc;
break;
return rcc;
}
}
return ret;
return NULL;
}
gboolean red_client_add_channel(RedClient *client, RedChannelClient *rcc, GError **error)