From c357fbf03668c7da18140864b6317387d3d0fc39 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 18 Dec 2024 14:02:54 +0100 Subject: [PATCH] LibWeb: Remove unused (Tree)Node::index_of_child() --- Libraries/LibWeb/DOM/Node.h | 33 --------------------------------- Libraries/LibWeb/TreeNode.h | 18 ------------------ 2 files changed, 51 deletions(-) diff --git a/Libraries/LibWeb/DOM/Node.h b/Libraries/LibWeb/DOM/Node.h index f1e509e872c..92fa32e31f2 100644 --- a/Libraries/LibWeb/DOM/Node.h +++ b/Libraries/LibWeb/DOM/Node.h @@ -389,39 +389,6 @@ public: return index; } - Optional 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 - Optional 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(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_inclusive_ancestor_of(Node const&) const; bool is_descendant_of(Node const&) const; diff --git a/Libraries/LibWeb/TreeNode.h b/Libraries/LibWeb/TreeNode.h index 7aaf0fc8403..498b7cedcde 100644 --- a/Libraries/LibWeb/TreeNode.h +++ b/Libraries/LibWeb/TreeNode.h @@ -41,24 +41,6 @@ public: return index; } - template - Optional 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(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_inclusive_ancestor_of(TreeNode const&) const;