From: Christian Dywan Date: Tue, 31 Mar 2009 20:20:24 +0000 (+0200) Subject: Optimize array iterations in the History panel X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09af4e67548362848830983a7e01862672447080;p=midori Optimize array iterations in the History panel --- diff --git a/panels/midori-history.c b/panels/midori-history.c index b3687fcd..18718ce4 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -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 {