mirror of
https://github.com/swaywm/sway.git
synced 2025-11-07 13:29:56 -05:00
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:
parent
e474d87e42
commit
31844bf42b
3 changed files with 3 additions and 22 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue