[cairo] [cairo-commit] Avoid copying region within _cairo_clip_intersect_region()

Carl Worth cworth at cworth.org
Wed Jun 17 09:05:03 PDT 2009


On Wed, 2009-06-17 at 08:21 -0700, Chris Wilson wrote: 
>      if (clip->region) {
>  	status = cairo_region_intersect (clip->region, region);
> -    } else {
> -	clip->region = cairo_region_copy (region);
> -
> -	assert (clip->region != NULL);
> -	
> -        if ((status = cairo_region_status (clip->region)))
> -	    clip->region = NULL;
> -    }
> +	cairo_region_destroy (region);
> +    } else
> +	clip->region = region;

Hi Chris,

The recent patches all look good. Thanks for continually improving
cairo!

I did want to remind you of one style point from cairo/CODING_STYLE. It
says:

If all of the substatements of an if statement are single statements,
the optional braces should not usually appear:

        if (condition)
            do_this ();
        else
            do_that ();

But the braces are mandatory when mixing single statement and compound
statements in the various clauses. For example, do not do this:

        if (condition) {
            do_this ();
            do_that ();
        } else                  /* Yuck! */
            do_the_other ();

Thanks,

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.cairographics.org/archives/cairo/attachments/20090617/0c3b94eb/attachment.pgp 


More information about the cairo mailing list