From 19e831ed3da2aba75d56e46c57967bcc60442d57 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Sat, 8 Dec 2018 22:52:29 +0000 Subject: list.c: Remove list_foreach Most occurrences have been replaced by `free_flat_list` which has been moved from stringop.c to list.c. The rest have been replaced by for loops. --- sway/commands/bind.c | 4 +--- sway/commands/reload.c | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'sway/commands') diff --git a/sway/commands/bind.c b/sway/commands/bind.c index c8b634b9..52a245fa 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c @@ -23,9 +23,7 @@ void free_sway_binding(struct sway_binding *binding) { return; } - if (binding->keys) { - free_flat_list(binding->keys); - } + free_flat_list(binding->keys); free(binding->input); free(binding->command); free(binding); diff --git a/sway/commands/reload.c b/sway/commands/reload.c index c64de4bd..c236911e 100644 --- a/sway/commands/reload.c +++ b/sway/commands/reload.c @@ -24,8 +24,7 @@ static void do_reload(void *data) { if (!load_main_config(config->current_config_path, true, false)) { wlr_log(WLR_ERROR, "Error(s) reloading config"); - list_foreach(bar_ids, free); - list_free(bar_ids); + free_flat_list(bar_ids); return; } @@ -42,9 +41,7 @@ static void do_reload(void *data) { } } } - - list_foreach(bar_ids, free); - list_free(bar_ids); + free_flat_list(bar_ids); config_update_font_height(true); root_for_each_container(rebuild_textures_iterator, NULL); -- cgit v1.2.3