[Spice-commits] server/red-client.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Feb 7 17:52:37 UTC 2020
server/red-client.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 9bc0aa76f66c2c3307651c4cc3ef2a13e422ab4f
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Feb 7 12:50:23 2020 +0000
red-client: Minor simplification for red_client_get_channel
Remove "ret" variable and just return the value
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Julien Rope <jrope at redhat.com>
diff --git a/server/red-client.c b/server/red-client.c
index 6cbfa72b..2bbe88b9 100644
--- a/server/red-client.c
+++ b/server/red-client.c
@@ -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)
More information about the Spice-commits
mailing list