[Xfce4-commits] <exo:master> Optimize returning the selected item.

Nick Schermer noreply at xfce.org
Sat Dec 15 21:30:03 CET 2012


Updating branch refs/heads/master
         to da1f87ebea14b7a91b46d1a2c332af5251b1b10a (commit)
       from c6387481c04f3f6a133296902f7d1294eab21a40 (commit)

commit da1f87ebea14b7a91b46d1a2c332af5251b1b10a
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Dec 15 21:26:52 2012 +0100

    Optimize returning the selected item.
    
    g_list_last is called a lot here, instead prepend and
    reverse the list at the end.

 exo/exo-icon-view.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exo/exo-icon-view.c b/exo/exo-icon-view.c
index 21f546b..7104433 100644
--- a/exo/exo-icon-view.c
+++ b/exo/exo-icon-view.c
@@ -5586,10 +5586,10 @@ exo_icon_view_get_selected_items (const ExoIconView *icon_view)
   for (i = 0, lp = icon_view->priv->items; lp != NULL; ++i, lp = lp->next)
     {
       if (EXO_ICON_VIEW_ITEM (lp->data)->selected)
-        selected = g_list_append (selected, gtk_tree_path_new_from_indices (i, -1));
+        selected = g_list_prepend (selected, gtk_tree_path_new_from_indices (i, -1));
     }
 
-  return selected;
+  return g_list_reverse (selected);
 }
 
 


More information about the Xfce4-commits mailing list