diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-11 15:36:19 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-11 15:36:19 +1000 |
commit | 31844bf42bc4b6549862ea4c4f077c1e19d9e7a1 (patch) | |
tree | f24bbab4a5a54936ddca9b823e4103ea630e993b /sway/tree/container.c | |
parent | Merge pull request #2447 from ianyfan/swaynag-leak (diff) | |
download | sway-31844bf42bc4b6549862ea4c4f077c1e19d9e7a1.tar.gz sway-31844bf42bc4b6549862ea4c4f077c1e19d9e7a1.tar.zst sway-31844bf42bc4b6549862ea4c4f077c1e19d9e7a1.zip |
Remove container_has_child
In all cases you can use container_has_ancestor with the arguments
swapped, which is faster than container_has_child.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index aecb2ac6..cec51af4 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -817,19 +817,6 @@ bool container_has_ancestor(struct sway_container *descendant, | |||
817 | return false; | 817 | return false; |
818 | } | 818 | } |
819 | 819 | ||
820 | static bool find_child_func(struct sway_container *con, void *data) { | ||
821 | struct sway_container *child = data; | ||
822 | return con == child; | ||
823 | } | ||
824 | |||
825 | bool container_has_child(struct sway_container *con, | ||
826 | struct sway_container *child) { | ||
827 | if (con == NULL || con->type == C_VIEW) { | ||
828 | return false; | ||
829 | } | ||
830 | return container_find(con, find_child_func, child); | ||
831 | } | ||
832 | |||
833 | int container_count_descendants_of_type(struct sway_container *con, | 820 | int container_count_descendants_of_type(struct sway_container *con, |
834 | enum sway_container_type type) { | 821 | enum sway_container_type type) { |
835 | int children = 0; | 822 | int children = 0; |