[Spice-devel] [PATCH 2/2] Reduce indentation inverting condition

Christophe Fergeau cfergeau at redhat.com
Tue Aug 2 09:15:13 UTC 2016


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Tue, Aug 02, 2016 at 10:12:21AM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/stream.c | 27 +++++++++++++--------------
>  1 file changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/server/stream.c b/server/stream.c
> index e56c419..e8c58fc 100644
> --- a/server/stream.c
> +++ b/server/stream.c
> @@ -250,20 +250,19 @@ static bool is_next_stream_frame(DisplayChannel *display,
>              return FALSE;
>          }
>      } else {
> -        if (rect_contains(&red_drawable->bbox, other_dest)) {
> -            int candidate_area = rect_get_area(&red_drawable->bbox);
> -            int other_area = rect_get_area(other_dest);
> -            /* do not stream drawables that are significantly
> -             * bigger than the original frame */
> -            if (candidate_area > 2 * other_area) {
> -                spice_debug("too big candidate:");
> -                spice_debug("prev box ==>");
> -                rect_debug(other_dest);
> -                spice_debug("new box ==>");
> -                rect_debug(&red_drawable->bbox);
> -                return FALSE;
> -            }
> -        } else {
> +        if (!rect_contains(&red_drawable->bbox, other_dest)) {
> +            return FALSE;
> +        }
> +        int candidate_area = rect_get_area(&red_drawable->bbox);
> +        int other_area = rect_get_area(other_dest);
> +        /* do not stream drawables that are significantly
> +         * bigger than the original frame */
> +        if (candidate_area > 2 * other_area) {
> +            spice_debug("too big candidate:");
> +            spice_debug("prev box ==>");
> +            rect_debug(other_dest);
> +            spice_debug("new box ==>");
> +            rect_debug(&red_drawable->bbox);
>              return FALSE;
>          }
>      }
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160802/14460e2c/attachment.sig>


More information about the Spice-devel mailing list