diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-12-08 22:52:29 +0000 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-12-09 00:37:50 +0000 |
commit | 19e831ed3da2aba75d56e46c57967bcc60442d57 (patch) | |
tree | edaa5855087f9d6f257c5c6dcd5eda0c4cc55b02 /sway/commands | |
parent | Merge pull request #3260 from RedSoxFan/split-flatten (diff) | |
download | sway-19e831ed3da2aba75d56e46c57967bcc60442d57.tar.gz sway-19e831ed3da2aba75d56e46c57967bcc60442d57.tar.zst sway-19e831ed3da2aba75d56e46c57967bcc60442d57.zip |
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.
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/bind.c | 4 | ||||
-rw-r--r-- | sway/commands/reload.c | 7 |
2 files changed, 3 insertions, 8 deletions
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) { | |||
23 | return; | 23 | return; |
24 | } | 24 | } |
25 | 25 | ||
26 | if (binding->keys) { | 26 | free_flat_list(binding->keys); |
27 | free_flat_list(binding->keys); | ||
28 | } | ||
29 | free(binding->input); | 27 | free(binding->input); |
30 | free(binding->command); | 28 | free(binding->command); |
31 | free(binding); | 29 | 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) { | |||
24 | 24 | ||
25 | if (!load_main_config(config->current_config_path, true, false)) { | 25 | if (!load_main_config(config->current_config_path, true, false)) { |
26 | wlr_log(WLR_ERROR, "Error(s) reloading config"); | 26 | wlr_log(WLR_ERROR, "Error(s) reloading config"); |
27 | list_foreach(bar_ids, free); | 27 | free_flat_list(bar_ids); |
28 | list_free(bar_ids); | ||
29 | return; | 28 | return; |
30 | } | 29 | } |
31 | 30 | ||
@@ -42,9 +41,7 @@ static void do_reload(void *data) { | |||
42 | } | 41 | } |
43 | } | 42 | } |
44 | } | 43 | } |
45 | 44 | free_flat_list(bar_ids); | |
46 | list_foreach(bar_ids, free); | ||
47 | list_free(bar_ids); | ||
48 | 45 | ||
49 | config_update_font_height(true); | 46 | config_update_font_height(true); |
50 | root_for_each_container(rebuild_textures_iterator, NULL); | 47 | root_for_each_container(rebuild_textures_iterator, NULL); |