[Spice-devel] [PATCH spice-gtk 3/3] spice-channel: Make some conditional code more readable

Frediano Ziglio fziglio at redhat.com
Mon Apr 16 10:43:26 UTC 2018


Avoid confusing indentation.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/spice-channel.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/spice-channel.c b/src/spice-channel.c
index 55bdef9..7e3e3b7 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -884,13 +884,12 @@ static void spice_channel_flush_sasl(SpiceChannel *channel, const void *data, si
 static void spice_channel_write(SpiceChannel *channel, const void *data, size_t len)
 {
 #ifdef HAVE_SASL
-    SpiceChannelPrivate *c = channel->priv;
-
-    if (c->sasl_conn)
+    if (channel->priv->sasl_conn) {
         spice_channel_flush_sasl(channel, data, len);
-    else
+        return;
+    }
 #endif
-        spice_channel_flush_wire(channel, data, len);
+    spice_channel_flush_wire(channel, data, len);
 }
 
 /* coroutine context */
-- 
2.14.3



More information about the Spice-devel mailing list