[gtk+] GtkStack: Remove some clumsy use of GList API
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkStack: Remove some clumsy use of GList API
- Date: Mon, 10 Nov 2014 23:47:28 +0000 (UTC)
commit c8d9e5b5643cff3c6170901efde686342832c266
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Nov 10 18:45:58 2014 -0500
GtkStack: Remove some clumsy use of GList API
No need for g_list_next(), and don't open-code g_list_index().
gtk/gtkstack.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 07cf11a..514e989 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -561,13 +561,13 @@ reorder_child (GtkStack *stack,
}
}
- l = g_list_next (l);
+ l = l->next;
num++;
}
g_return_if_fail (old_link != NULL);
- if (old_link == new_link || (g_list_next (old_link) == NULL && new_link == NULL))
+ if (old_link == new_link || (old_link->next == NULL && new_link == NULL))
return;
priv->children = g_list_delete_link (priv->children, old_link);
@@ -611,14 +611,7 @@ gtk_stack_get_child_property (GtkContainer *container,
break;
case CHILD_PROP_POSITION:
- i = 0;
- for (list = priv->children; list != NULL; list = g_list_next (list))
- {
- if (info == list->data)
- break;
- ++i;
- }
- g_value_set_int (value, i);
+ g_value_set_int (value, g_list_index (priv->children, info));
break;
case CHILD_PROP_NEEDS_ATTENTION:
@@ -1050,7 +1043,7 @@ set_visible_child (GtkStack *stack,
else if (is_direction_dependent_transition (transition_type))
{
gboolean i_first = FALSE;
- for (l = priv->children; l != NULL; l = g_list_next (l))
+ for (l = priv->children; l != NULL; l = l->next)
{
if (child_info == l->data)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]