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

Snir Sheriber ssheribe at redhat.com
Mon Apr 16 11:38:57 UTC 2018


ack


On 04/16/2018 01:43 PM, Frediano Ziglio wrote:
> 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 */



More information about the Spice-devel mailing list