From 52036871d111113ed0f74539ec2419132ba50015 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 15 Nov 2012 15:16:12 +0000 Subject: [PATCH] StThemeNode: add a trivial-case short cut to all comparisons for equality Bug: https://bugzilla.gnome.org/show_bug.cgi?id=687465 Reviewed-by: Jasper St. Pierre --- src/st/st-theme-node.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index 880029982..766e0733d 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -341,6 +341,10 @@ gboolean st_theme_node_equal (StThemeNode *node_a, StThemeNode *node_b) { g_return_val_if_fail (ST_IS_THEME_NODE (node_a), FALSE); + + if (node_a == node_b) + return TRUE; + g_return_val_if_fail (ST_IS_THEME_NODE (node_b), FALSE); if (node_a->parent_node != node_b->parent_node || @@ -3548,6 +3552,10 @@ st_theme_node_geometry_equal (StThemeNode *node, StSide side; g_return_val_if_fail (ST_IS_THEME_NODE (node), FALSE); + + if (node == other) + return TRUE; + g_return_val_if_fail (ST_IS_THEME_NODE (other), FALSE); _st_theme_node_ensure_geometry (node); @@ -3592,6 +3600,10 @@ st_theme_node_paint_equal (StThemeNode *node, int i; g_return_val_if_fail (ST_IS_THEME_NODE (node), FALSE); + + if (node == other) + return TRUE; + g_return_val_if_fail (ST_IS_THEME_NODE (other), FALSE); _st_theme_node_ensure_background (node);