mirror of https://github.com/GNOME/gimp.git
libgimpcolor: add shortcut in gimp_color_profile_is_equal()
When the two pointers are equal, return TRUE immediately, instead of comparing the profile to itself.
This commit is contained in:
parent
2520e0455c
commit
22a28a23cc
|
@ -667,9 +667,10 @@ gimp_color_profile_is_equal (GimpColorProfile *profile1,
|
|||
const gsize header_len = sizeof (cmsICCHeader);
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile1), FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile1), FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile2), FALSE);
|
||||
|
||||
return (profile1->priv->length == profile2->priv->length &&
|
||||
return profile1 == profile2 ||
|
||||
(profile1->priv->length == profile2->priv->length &&
|
||||
memcmp (profile1->priv->data + header_len,
|
||||
profile2->priv->data + header_len,
|
||||
profile1->priv->length - header_len) == 0);
|
||||
|
|
Loading…
Reference in New Issue