Simplify thumb_std_maint_moved(), since g_list_append knows
authorLaurent Monin <geeqie@norz.org>
Wed, 14 May 2008 17:00:25 +0000 (17:00 +0000)
committerLaurent Monin <geeqie@norz.org>
Wed, 14 May 2008 17:00:25 +0000 (17:00 +0000)
how to append to a NULL list. Patch by Uwe Ohse.

src/thumb_standard.c

index 4f48860..7ddd222 100644 (file)
@@ -1068,14 +1068,8 @@ void thumb_std_maint_moved(const gchar *source, const gchar *dest)
                g_idle_add_full(G_PRIORITY_LOW, thumb_std_maint_move_idle, NULL, NULL);
                }
 
-       if (thumb_std_maint_move_tail)
-               {
-               thumb_std_maint_move_tail = g_list_append(thumb_std_maint_move_tail, tm);
-               thumb_std_maint_move_tail = thumb_std_maint_move_tail->next;
-               }
-       else
-               {
-               thumb_std_maint_move_list = g_list_append(thumb_std_maint_move_list, tm);
-               thumb_std_maint_move_tail = thumb_std_maint_move_list;
-               }
+       thumb_std_maint_move_tail = g_list_append(thumb_std_maint_move_tail, tm);
+       if (!thumb_std_maint_move_list)
+               thumb_std_maint_move_list = thumb_std_maint_move_tail;
+       thumb_std_maint_move_tail = thumb_std_maint_move_tail->next;
 }