Optimize array iterations in the History panel

This commit is contained in:
Christian Dywan 2009-03-31 22:20:24 +02:00
parent d14b65563a
commit 09af4e6754

View file

@ -441,7 +441,8 @@ midori_history_insert_item (MidoriHistory* history,
{ {
GtkTreeIter* piter; GtkTreeIter* piter;
gint64 pday; gint64 pday;
guint i, n; guint i;
KatzeItem* child;
g_signal_connect (item, "add-item", g_signal_connect (item, "add-item",
G_CALLBACK (midori_history_add_item_cb), history); G_CALLBACK (midori_history_add_item_cb), history);
@ -459,15 +460,10 @@ midori_history_insert_item (MidoriHistory* history,
g_object_unref (item); g_object_unref (item);
piter = &iter; piter = &iter;
} }
n = katze_array_get_length (KATZE_ARRAY (item)); i = 0;
for (i = 0; i < n; i++) while ((child = katze_array_get_nth_item (KATZE_ARRAY (item), i++)))
{
KatzeItem* child;
child = katze_array_get_nth_item (KATZE_ARRAY (item), i);
midori_history_insert_item (history, treestore, piter, child, day); midori_history_insert_item (history, treestore, piter, child, day);
} }
}
else else
{ {
gtk_tree_store_insert_with_values (treestore, &iter, parent, gtk_tree_store_insert_with_values (treestore, &iter, parent,