From 09af4e67548362848830983a7e01862672447080 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 31 Mar 2009 22:20:24 +0200 Subject: [PATCH] Optimize array iterations in the History panel --- panels/midori-history.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 { -- 2.39.5