[gnome-photos/wip/rishi/item-manager: 2/12] item-manager: Simplify photos_item_manager_remove_object_by_id



commit dd5dceb9160e727231a73d33b9efcd9c684b6f0c
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Aug 19 09:08:12 2016 +0200

    item-manager: Simplify photos_item_manager_remove_object_by_id
    
    ... because g_hash_table_remove can handle attempts to remove
    non-existing keys.

 src/photos-item-manager.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 2ed21dd..26b8395 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -285,15 +285,8 @@ static void
 photos_item_manager_remove_object_by_id (PhotosBaseManager *mngr, const gchar *id)
 {
   PhotosItemManager *self = PHOTOS_ITEM_MANAGER (mngr);
-  gpointer *collection;
-
-  collection = g_hash_table_lookup (self->collections, id);
-  if (collection == NULL)
-    goto end;
 
   g_hash_table_remove (self->collections, id);
-
- end:
   PHOTOS_BASE_MANAGER_CLASS (photos_item_manager_parent_class)->remove_object_by_id (mngr, id);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]