diff options
author | jcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2008-06-01 08:47:54 +0000 |
---|---|---|
committer | jcsjcs <jcsjcs@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2008-06-01 08:47:54 +0000 |
commit | 0572f812f48699d9abc2ee3cb9ed0ee987fed611 (patch) | |
tree | 51792b8c722c2d47991994192140cb74ade97748 | |
parent | 91b0663366059c3af220b2eee08a8448482ad45b (diff) | |
download | libgpod-0572f812f48699d9abc2ee3cb9ed0ee987fed611.tar.gz libgpod-0572f812f48699d9abc2ee3cb9ed0ee987fed611.tar.xz libgpod-0572f812f48699d9abc2ee3cb9ed0ee987fed611.zip |
* src/itdb_thumb.c
remove some unnecessary checks for NULL pointer
(itdb_thumb_duplicate): move g_list_reverse() outside the loop
modifying the list.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2004 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/itdb_thumb.c | 10 |
2 files changed, 10 insertions, 7 deletions
@@ -1,3 +1,10 @@ +2008-06-01 Jorg Schuler <jcsjcs at users.sourceforge.net> + + * src/itdb_thumb.c + remove some unnecessary checks for NULL pointer + (itdb_thumb_duplicate): move g_list_reverse() outside the loop + modifying the list. + 2008-05-30 Jorg Schuler <jcsjcs at users.sourceforge.net> * src/itdb_thumb.c diff --git a/src/itdb_thumb.c b/src/itdb_thumb.c index f65abd1..d5f1886 100644 --- a/src/itdb_thumb.c +++ b/src/itdb_thumb.c @@ -152,9 +152,7 @@ itdb_thumb_ipod_item_duplicate (Itdb_Thumb_Ipod_Item *item) g_return_val_if_fail (item != NULL, NULL); new_item = itdb_thumb_new_item_from_ipod (item->format); - if (new_item == NULL) { - return NULL; - } + new_item->filename = g_strdup (item->filename); new_item->offset = item->offset; new_item->size = item->size; @@ -198,17 +196,14 @@ Itdb_Thumb *itdb_thumb_duplicate (Itdb_Thumb *thumb) Itdb_Thumb_Ipod *new_thumb; GList *it; new_thumb = (Itdb_Thumb_Ipod *)itdb_thumb_ipod_new (); - if (new_thumb == NULL) { - return NULL; - } for (it = thumb_ipod->thumbs; it != NULL; it = it->next) { Itdb_Thumb_Ipod_Item *item; item = itdb_thumb_ipod_item_duplicate (it->data); if (item != NULL) { itdb_thumb_ipod_add (new_thumb, item); } - new_thumb->thumbs = g_list_reverse (new_thumb->thumbs); } + new_thumb->thumbs = g_list_reverse (new_thumb->thumbs); return (Itdb_Thumb *)new_thumb; } case ITDB_THUMB_TYPE_INVALID: @@ -360,6 +355,7 @@ gpointer itdb_thumb_to_pixbuf_at_size (Itdb_Device *device, Itdb_Thumb *thumb, gint width, gint height) { GdkPixbuf *pixbuf=NULL; + if (thumb->data_type == ITDB_THUMB_TYPE_FILE) { Itdb_Thumb_File *thumb_file = (Itdb_Thumb_File *)thumb; |