]> spindle.queued.net Git - midori/commitdiff
Optimize array iterations in the History panel
authorChristian Dywan <christian@twotoasts.de>
Tue, 31 Mar 2009 20:20:24 +0000 (22:20 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 31 Mar 2009 20:20:24 +0000 (22:20 +0200)
panels/midori-history.c

index b3687fcd79de7943eb95673a9c05f3e91735a0df..18718ce417e204ebf77aaae5235de9b4aa00eea9 100644 (file)
@@ -441,7 +441,8 @@ midori_history_insert_item (MidoriHistory* history,
     {
         GtkTreeIter* piter;
         gint64 pday;
-        guint i, n;
+        guint i;
+        KatzeItem* child;
 
         g_signal_connect (item, "add-item",
             G_CALLBACK (midori_history_add_item_cb), history);
@@ -459,14 +460,9 @@ midori_history_insert_item (MidoriHistory* history,
             g_object_unref (item);
             piter = &iter;
         }
-        n = katze_array_get_length (KATZE_ARRAY (item));
-        for (i = 0; i < n; i++)
-        {
-            KatzeItem* child;
-
-            child = katze_array_get_nth_item (KATZE_ARRAY (item), i);
+        i = 0;
+        while ((child = katze_array_get_nth_item (KATZE_ARRAY (item), i++)))
             midori_history_insert_item (history, treestore, piter, child, day);
-        }
     }
     else
     {