[gnome-shell] st/shadow: Add a fast path to comparisons



commit 3b4a1fcd51c087bb242fe3f8e3bd7a1280bd0aa9
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Fri Mar 5 12:28:39 2021 +0100

    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>

 src/st/st-shadow.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c
index ab3eaa856b..0a8e319ad4 100644
--- a/src/st/st-shadow.c
+++ b/src/st/st-shadow.c
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]