Merge pull request #2484 from ianyfan/con-for-each-child-fix
Fix double iterating in container_for_each_child
This commit is contained in:
commit
373f0254a8
|
@ -737,10 +737,10 @@ void container_for_each_child(struct sway_container *container,
|
||||||
container->type == C_VIEW, "Expected a container or view")) {
|
container->type == C_VIEW, "Expected a container or view")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
f(container, data);
|
|
||||||
if (container->children) {
|
if (container->children) {
|
||||||
for (int i = 0; i < container->children->length; ++i) {
|
for (int i = 0; i < container->children->length; ++i) {
|
||||||
struct sway_container *child = container->children->items[i];
|
struct sway_container *child = container->children->items[i];
|
||||||
|
f(child, data);
|
||||||
container_for_each_child(child, f, data);
|
container_for_each_child(child, f, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue