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/config.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index ff7de4b9..efb95e31 100644 --- a/sway/config.c +++ b/sway/config.c @@ -654,8 +654,7 @@ bool read_config(FILE *file, struct sway_config *config, if (read + length > config_size) { wlr_log(WLR_ERROR, "Config file changed during reading"); - list_foreach(stack, free); - list_free(stack); + free_flat_list(stack); free(line); return false; } @@ -684,8 +683,7 @@ bool read_config(FILE *file, struct sway_config *config, } char *expanded = expand_line(block, line, brace_detected > 0); if (!expanded) { - list_foreach(stack, free); - list_free(stack); + free_flat_list(stack); free(line); return false; } @@ -750,8 +748,7 @@ bool read_config(FILE *file, struct sway_config *config, free(line); free_cmd_results(res); } - list_foreach(stack, free); - list_free(stack); + free_flat_list(stack); config->current_config_line_number = 0; config->current_config_line = NULL; -- cgit v1.2.3-54-g00ecf