[PATCH 3/6] cairo-util: Kill a duplicate test

Bryce W. Harrington b.harrington at samsung.com
Mon Apr 28 16:49:07 PDT 2014


On Mon, Apr 28, 2014 at 11:19:29AM -0400, Jasper St. Pierre wrote:
> If !(x < margin), then clearly margin <= x. No need to test for it again.

Yep, this looks correct, and clearer logic.

Reviewed-by: Bryce Harrington <b.harrington at samsung.com>
> ---
>  shared/cairo-util.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/shared/cairo-util.c b/shared/cairo-util.c
> index 3948572..a1568ff 100644
> --- a/shared/cairo-util.c
> +++ b/shared/cairo-util.c
> @@ -500,7 +500,7 @@ theme_get_location(struct theme *t, int x, int y,
>  
>  	if (x < margin)
>  		hlocation = THEME_LOCATION_EXTERIOR;
> -	else if (margin <= x && x < margin + grip_size)
> +	else if (x < margin + grip_size)
>  		hlocation = THEME_LOCATION_RESIZING_LEFT;
>  	else if (x < width - margin - grip_size)
>  		hlocation = THEME_LOCATION_INTERIOR;
> @@ -511,7 +511,7 @@ theme_get_location(struct theme *t, int x, int y,
>  
>  	if (y < margin)
>  		vlocation = THEME_LOCATION_EXTERIOR;
> -	else if (margin <= y && y < margin + grip_size)
> +	else if (y < margin + grip_size)
>  		vlocation = THEME_LOCATION_RESIZING_TOP;
>  	else if (y < height - margin - grip_size)
>  		vlocation = THEME_LOCATION_INTERIOR;
> -- 
> 1.9.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list