[gnome-shell] StThemeNode: add a trivial-case short cut to all comparisons for equality
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] StThemeNode: add a trivial-case short cut to all comparisons for equality
- Date: Thu, 15 Nov 2012 17:08:53 +0000 (UTC)
commit 52036871d111113ed0f74539ec2419132ba50015
Author: Simon McVittie <simon mcvittie collabora co uk>
Date: Thu Nov 15 15:16:12 2012 +0000
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 <jstpierre mecheye net>
src/st/st-theme-node.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c
index 8800299..766e073 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]