From 980e4c611297ea51d7eabdfa6d473c04de755ae8 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 18 Jun 2010 14:20:10 +0000 Subject: [PATCH] Remove foreach_slist_free() macro - not worth the complexity (list nodes are probably cached anyway). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5050 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- plugins/filebrowser.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/filebrowser.c b/plugins/filebrowser.c index 660762c0..32ef28b9 100644 --- a/plugins/filebrowser.c +++ b/plugins/filebrowser.c @@ -257,10 +257,6 @@ static void clear(void) } -/* Reuses list to free each node, so list must be a variable */ -#define foreach_slist_free(node, list) \ - for (node = list, list = NULL; g_slist_free_1(list), node != NULL; list = node, node = node->next) - /* recreate the tree model from current_dir. */ static void refresh(void) { @@ -283,14 +279,15 @@ static void refresh(void) list = utils_get_file_list(current_dir, NULL, NULL); if (list != NULL) { - /* free filenames & nodes as we go through the list */ - foreach_slist_free(node, list) + /* free filenames as we go through the list */ + foreach_slist(node, list) { gchar *fname = node->data; add_item(fname); g_free(fname); } + g_slist_free(list); } gtk_entry_completion_set_model(entry_completion, GTK_TREE_MODEL(file_store)); }