app: speed up GimpTagCache saving

Use g_list_prepend() and g_list_reverse() instead of g_list_append().
This commit is contained in:
Michael Natterer 2011-06-16 20:20:39 +02:00
parent 580b5ba624
commit 3c28ed4303
1 changed files with 4 additions and 2 deletions

View File

@ -337,7 +337,7 @@ gimp_tag_cache_tagged_to_cache_record_foreach (GimpTagged *tagged,
g_free (checksum);
*cache_records = g_list_append (*cache_records, cache_rec);
*cache_records = g_list_prepend (*cache_records, cache_rec);
}
g_free (identifier);
@ -378,7 +378,7 @@ gimp_tag_cache_save (GimpTagCache *cache)
record_copy->checksum = current_record->checksum;
record_copy->tags = g_list_copy (current_record->tags);
saved_records = g_list_append (saved_records, record_copy);
saved_records = g_list_prepend (saved_records, record_copy);
}
}
@ -391,6 +391,8 @@ gimp_tag_cache_save (GimpTagCache *cache)
&saved_records);
}
saved_records = g_list_reverse (saved_records);
buf = g_string_new ("");
g_string_append (buf, "<?xml version='1.0' encoding='UTF-8'?>\n");
g_string_append (buf, "<tags>\n");