Remove container_has_child

In all cases you can use container_has_ancestor with the arguments
swapped, which is faster than container_has_child.
This commit is contained in:
Ryan Dwyer 2018-08-11 15:36:19 +10:00
parent e474d87e42
commit 31844bf42b
3 changed files with 3 additions and 22 deletions

View file

@ -817,19 +817,6 @@ bool container_has_ancestor(struct sway_container *descendant,
return false;
}
static bool find_child_func(struct sway_container *con, void *data) {
struct sway_container *child = data;
return con == child;
}
bool container_has_child(struct sway_container *con,
struct sway_container *child) {
if (con == NULL || con->type == C_VIEW) {
return false;
}
return container_find(con, find_child_func, child);
}
int container_count_descendants_of_type(struct sway_container *con,
enum sway_container_type type) {
int children = 0;