]> Pileus Git - ~andy/gtk/commitdiff
Improve the efficiency here by prepending on the list and reverting it
authorMatthias Clasen <maclas@gmx.de>
Wed, 18 Feb 2004 23:42:46 +0000 (23:42 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 18 Feb 2004 23:42:46 +0000 (23:42 +0000)
Thu Feb 19 00:45:02 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows):
Improve the efficiency here by prepending on the list and reverting
it after the loop.  (#133435, Christian Biere)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeselection.c

index 3795cc1dea127276bee419aa27051a02737051df..d014d0fb9c8a6dbb2b26a375c2176f001eb0026b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 19 00:45:02 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows): 
+       Improve the efficiency here by prepending on the list and reverting
+       it after the loop.  (#133435, Christian Biere)
+
 Thu Feb 19 00:32:21 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkplug.c (_gtk_plug_remove_from_socket): Avoid errors when
index 3795cc1dea127276bee419aa27051a02737051df..d014d0fb9c8a6dbb2b26a375c2176f001eb0026b 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 19 00:45:02 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows): 
+       Improve the efficiency here by prepending on the list and reverting
+       it after the loop.  (#133435, Christian Biere)
+
 Thu Feb 19 00:32:21 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkplug.c (_gtk_plug_remove_from_socket): Avoid errors when
index 3795cc1dea127276bee419aa27051a02737051df..d014d0fb9c8a6dbb2b26a375c2176f001eb0026b 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 19 00:45:02 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows): 
+       Improve the efficiency here by prepending on the list and reverting
+       it after the loop.  (#133435, Christian Biere)
+
 Thu Feb 19 00:32:21 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkplug.c (_gtk_plug_remove_from_socket): Avoid errors when
index 3795cc1dea127276bee419aa27051a02737051df..d014d0fb9c8a6dbb2b26a375c2176f001eb0026b 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 19 00:45:02 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows): 
+       Improve the efficiency here by prepending on the list and reverting
+       it after the loop.  (#133435, Christian Biere)
+
 Thu Feb 19 00:32:21 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkplug.c (_gtk_plug_remove_from_socket): Avoid errors when
index 3795cc1dea127276bee419aa27051a02737051df..d014d0fb9c8a6dbb2b26a375c2176f001eb0026b 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 19 00:45:02 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtktreeselection.c (gtk_tree_selection_get_selected_rows): 
+       Improve the efficiency here by prepending on the list and reverting
+       it after the loop.  (#133435, Christian Biere)
+
 Thu Feb 19 00:32:21 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkplug.c (_gtk_plug_remove_from_socket): Avoid errors when
index 67c37ef359107d3e74ff60b084a6ef096337a774..94cd4b1d843709e14c4ca5a0ca0ce3f0f3aff4ea 100644 (file)
@@ -474,7 +474,7 @@ gtk_tree_selection_get_selected_rows (GtkTreeSelection   *selection,
   do
     {
       if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
-       list = g_list_append (list, gtk_tree_path_copy (path));
+       list = g_list_prepend (list, gtk_tree_path_copy (path));
 
       if (node->children)
         {
@@ -506,7 +506,8 @@ gtk_tree_selection_get_selected_rows (GtkTreeSelection   *selection,
                  if (!tree)
                    {
                      gtk_tree_path_free (path);
-                     return list;
+
+                     goto done; 
                    }
 
                  gtk_tree_path_up (path);
@@ -519,7 +520,8 @@ gtk_tree_selection_get_selected_rows (GtkTreeSelection   *selection,
 
   gtk_tree_path_free (path);
 
-  return list;
+ done:
+  return g_list_reverse (list);
 }
 
 static void