Author: kelnos
Date: 2008-02-28 13:36:56 +0000 (Thu, 28 Feb 2008)
New Revision: 26651

Modified:
   xfdesktop/branches/xfce_4_4/modules/menu/desktop-menu-cache.c
Log:
simplify some code


Modified: xfdesktop/branches/xfce_4_4/modules/menu/desktop-menu-cache.c
===================================================================
--- xfdesktop/branches/xfce_4_4/modules/menu/desktop-menu-cache.c       
2008-02-28 02:57:40 UTC (rev 26650)
+++ xfdesktop/branches/xfce_4_4/modules/menu/desktop-menu-cache.c       
2008-02-28 13:36:56 UTC (rev 26651)
@@ -453,17 +453,11 @@
         menu_tree = NULL;
     }
     
-    for(l = menu_files; l; l = l->next)
-        g_free(l->data);
-    if(menu_files) {
-        g_list_free(menu_files);
-        menu_files = NULL;
-    }
+    g_list_foreach(menu_files, (GFunc)g_free, NULL);
+    g_list_free(menu_files);
+    menu_files = NULL;
     
-    for(l = dentry_dirs; l; l = l->next)
-        g_free(l->data);
-    if(dentry_dirs) {
-        g_list_free(dentry_dirs);
-        dentry_dirs = NULL;
-    }
+    g_list_foreach(dentry_dirs, (GFunc)g_free, NULL);
+    g_list_free(dentry_dirs);
+    dentry_dirs = NULL;
 }

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to