# HG changeset patch # User nadvornik # Date 1213447419 0 # Node ID a14d7da2736df8614c47189d4773157c1b16012b # Parent b02a24ebf4416a5e4d3e60b8fef3d7533f634e03 iconlist_refresh optimization diff -r b02a24ebf441 -r a14d7da2736d src/view_file_icon.c --- a/src/view_file_icon.c Sat Jun 14 12:30:44 2008 +0000 +++ b/src/view_file_icon.c Sat Jun 14 12:43:39 2008 +0000 @@ -2084,6 +2084,7 @@ GList *new_filelist = NULL; GList *selected; gint num_selected = 0; + GList *new_iconlist = NULL; focus_id = VFICON_INFO(vf, focus_id); @@ -2157,12 +2158,21 @@ id->selected = SELECTION_NONE; id->row = -1; id->fd = file_data_ref(new_fd); - vf->list = g_list_insert_before(vf->list, work, id); + if (work) + vf->list = g_list_insert_before(vf->list, work, id); + else + new_iconlist = g_list_prepend(new_iconlist, id); /* it is faster to append all new entries together later */ + work_fd = work_fd->next; } } + if (new_iconlist) + { + vf->list = g_list_concat(vf->list, g_list_reverse(new_iconlist)); + } + filelist_free(new_filelist); vficon_populate(vf, TRUE, keep_position);