[anjuta] anjuta-tabber: don't iterate list to check if node is first/last



commit c7cf9156849385a85e97262e59fb0a6bddceadf0
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Sun Apr 14 22:48:42 2013 +0200

    anjuta-tabber: don't iterate list to check if node is first/last

 libanjuta/anjuta-tabber.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libanjuta/anjuta-tabber.c b/libanjuta/anjuta-tabber.c
index be17916..da09adf 100644
--- a/libanjuta/anjuta-tabber.c
+++ b/libanjuta/anjuta-tabber.c
@@ -266,9 +266,9 @@ anjuta_tabber_get_preferred_width (GtkWidget* widget,
 
                xpadding =  2 * (focus_width + focus_pad) + tab_padding.left + tab_padding.right;
                
-               if (child == g_list_first (tabber->priv->children))
+               if (child->prev == NULL)
                        extra_space += tab_overlap;
-               if (child == g_list_last (tabber->priv->children))
+               if (child->next == NULL)
                        extra_space += tab_overlap;
                
                gtk_widget_get_preferred_width (GTK_WIDGET (child->data), &child_min, &child_preferred);


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