st/shadow: Add a fast path to comparisons

We do this in most places in St, it's consistent to do it here, too.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1744>
This commit is contained in:
Jonas Dreßler 2021-03-05 12:28:39 +01:00 committed by Marge Bot
parent 8b3e1e01f6
commit 3b4a1fcd51

View File

@ -126,6 +126,9 @@ st_shadow_equal (StShadow *shadow,
g_return_val_if_fail (shadow != NULL, FALSE);
g_return_val_if_fail (other != NULL, FALSE);
if (shadow == other)
return TRUE;
/* We use strict equality to compare double quantities; this means
* that, for example, a shadow offset of 0.25in does not necessarily
* compare equal to a shadow offset of 18pt in this test. Assume