From 6a8701c4db7cb8432c1114ca31123e055e2c5b05 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 25 Jul 2024 17:31:17 +0200 Subject: [PATCH] clutter/color-state: Optimize equality by checking pointer equality Part-of: --- clutter/clutter/clutter-color-state.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/clutter/clutter-color-state.c b/clutter/clutter/clutter-color-state.c index fab883aff..0d5fbaa8e 100644 --- a/clutter/clutter/clutter-color-state.c +++ b/clutter/clutter/clutter-color-state.c @@ -846,6 +846,9 @@ clutter_color_state_equals (ClutterColorState *color_state, g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (color_state), FALSE); g_return_val_if_fail (CLUTTER_IS_COLOR_STATE (other_color_state), FALSE); + if (color_state == other_color_state) + return TRUE; + priv = clutter_color_state_get_instance_private (color_state); other_priv = clutter_color_state_get_instance_private (other_color_state);