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/tree | |
parent | 0c3f0dfd16b73f659c4eddd42ae9467bfc25a19c (diff) | |
download | sway-19e831ed3da2aba75d56e46c57967bcc60442d57.tar.xz |
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/tree')
-rw-r--r-- | sway/tree/container.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 91e8dd7f..ac433577 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -21,6 +21,7 @@ #include "sway/tree/arrange.h" #include "sway/tree/view.h" #include "sway/tree/workspace.h" +#include "list.h" #include "log.h" #include "stringop.h" @@ -67,8 +68,7 @@ void container_destroy(struct sway_container *con) { list_free(con->current.children); list_free(con->outputs); - list_foreach(con->marks, free); - list_free(con->marks); + free_flat_list(con->marks); wlr_texture_destroy(con->marks_focused); wlr_texture_destroy(con->marks_focused_inactive); wlr_texture_destroy(con->marks_unfocused); @@ -1267,7 +1267,9 @@ bool container_find_and_unmark(char *mark) { } void container_clear_marks(struct sway_container *con) { - list_foreach(con->marks, free); + for (int i = 0; i < con->marks->length; ++i) { + free(con->marks->items[i]); + } con->marks->length = 0; ipc_event_window(con, "mark"); } |