mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb: Remove unused (Tree)Node::index_of_child()
This commit is contained in:
parent
637f934f69
commit
c357fbf036
Notes:
github-actions[bot]
2024-12-18 23:47:29 +00:00
Author: https://github.com/gmta
Commit: c357fbf036
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2963
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 0 additions and 51 deletions
|
@ -389,39 +389,6 @@ public:
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<size_t> index_of_child(Node const& search_child)
|
|
||||||
{
|
|
||||||
VERIFY(search_child.parent() == this);
|
|
||||||
size_t index = 0;
|
|
||||||
auto* child = first_child();
|
|
||||||
VERIFY(child);
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (child == &search_child)
|
|
||||||
return index;
|
|
||||||
index++;
|
|
||||||
} while (child && (child = child->next_sibling()));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ChildType>
|
|
||||||
Optional<size_t> index_of_child(Node const& search_child)
|
|
||||||
{
|
|
||||||
VERIFY(search_child.parent() == this);
|
|
||||||
size_t index = 0;
|
|
||||||
auto* child = first_child();
|
|
||||||
VERIFY(child);
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (!is<ChildType>(child))
|
|
||||||
continue;
|
|
||||||
if (child == &search_child)
|
|
||||||
return index;
|
|
||||||
index++;
|
|
||||||
} while (child && (child = child->next_sibling()));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_ancestor_of(Node const&) const;
|
bool is_ancestor_of(Node const&) const;
|
||||||
bool is_inclusive_ancestor_of(Node const&) const;
|
bool is_inclusive_ancestor_of(Node const&) const;
|
||||||
bool is_descendant_of(Node const&) const;
|
bool is_descendant_of(Node const&) const;
|
||||||
|
|
|
@ -41,24 +41,6 @@ public:
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ChildType>
|
|
||||||
Optional<size_t> index_of_child(T const& search_child)
|
|
||||||
{
|
|
||||||
VERIFY(search_child.parent() == this);
|
|
||||||
size_t index = 0;
|
|
||||||
auto* child = first_child();
|
|
||||||
VERIFY(child);
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (!is<ChildType>(child))
|
|
||||||
continue;
|
|
||||||
if (child == &search_child)
|
|
||||||
return index;
|
|
||||||
index++;
|
|
||||||
} while (child && (child = child->next_sibling()));
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_ancestor_of(TreeNode const&) const;
|
bool is_ancestor_of(TreeNode const&) const;
|
||||||
bool is_inclusive_ancestor_of(TreeNode const&) const;
|
bool is_inclusive_ancestor_of(TreeNode const&) const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue