[cairo-color] Only compare the shorts for equality.

By only checking the premultiplied shorts inside the cairo_color_t we
only have to compare at most 8 bytes instead of the full 24 bytes.
This commit is contained in:
Chris Wilson 2007-05-05 12:33:29 +01:00
parent 966a39396e
commit d81907734e

View file

@ -165,5 +165,8 @@ cairo_bool_t
_cairo_color_equal (const cairo_color_t *color_a,
const cairo_color_t *color_b)
{
return memcmp (color_a, color_b, sizeof (cairo_color_t)) == 0;
return color_a->red_short == color_b->red_short &&
color_a->green_short == color_b->green_short &&
color_a->blue_short == color_b->blue_short &&
color_a->alpha_short == color_b->alpha_short;
}