summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/itdb_photoalbum.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c3bd5d..30bca1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-14 Christophe <teuf@gnome.org>
+
+ * src/itdb_photoalbum.c: use g_list_remove all instead of an
+ inefficient combination of g_list_find + g_list_remove
+
2007-11-14 Jorg Schuler <jcsjcs at users.sourceforge.net>
* src/itdb_photoalbum.c (itdb_photodb_photoalbum_remove): make
diff --git a/src/itdb_photoalbum.c b/src/itdb_photoalbum.c
index e53686a..994875e 100644
--- a/src/itdb_photoalbum.c
+++ b/src/itdb_photoalbum.c
@@ -615,10 +615,7 @@ void itdb_photodb_remove_photo (Itdb_PhotoDB *db,
for (it = db->photoalbums; it != NULL; it = it->next)
{
Itdb_PhotoAlbum *_album = it->data;
- while (g_list_find (_album->members, photo))
- {
- _album->members = g_list_remove (_album->members, photo);
- }
+ _album->members = g_list_remove_all (_album->members, photo);
}
/* Remove the photo from the image list */
db->photos = g_list_remove (db->photos, photo);