aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-08-18 18:10:41 +0100
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-08-18 18:10:41 +0100
commit1be75fe7403fd64e084008b0ed677fa4df32ed5b (patch)
tree50564536b73fac3147186ff2c562289df8a4b3f2 /sway/tree/container.c
parentMerge pull request #2473 from RyanDwyer/iterators-per-type (diff)
downloadsway-1be75fe7403fd64e084008b0ed677fa4df32ed5b.tar.gz
sway-1be75fe7403fd64e084008b0ed677fa4df32ed5b.tar.zst
sway-1be75fe7403fd64e084008b0ed677fa4df32ed5b.zip
Fix double iterating in container_for_each_child
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 1ceae175..9bc4f544 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -737,10 +737,10 @@ void container_for_each_child(struct sway_container *container,
737 container->type == C_VIEW, "Expected a container or view")) { 737 container->type == C_VIEW, "Expected a container or view")) {
738 return; 738 return;
739 } 739 }
740 f(container, data);
741 if (container->children) { 740 if (container->children) {
742 for (int i = 0; i < container->children->length; ++i) { 741 for (int i = 0; i < container->children->length; ++i) {
743 struct sway_container *child = container->children->items[i]; 742 struct sway_container *child = container->children->items[i];
743 f(child, data);
744 container_for_each_child(child, f, data); 744 container_for_each_child(child, f, data);
745 } 745 }
746 } 746 }