Skip to content

Commit 620b622

Browse files
committed
Optimize checks for DOMParentNode and DOMChildNode
Because we check the list with dom_sanity_check_node_list_for_insertion() before dom_is_node_in_list(), then we don't have to check the object type anymore in dom_is_node_in_list(), because dom_sanity_check_node_list_for_insertion() will have already done that. Closes GH-11914.
1 parent 23ba4cd commit 620b622

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ext/dom/parentnode.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,8 @@ static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNod
128128
{
129129
for (uint32_t i = 0; i < nodesc; i++) {
130130
if (Z_TYPE(nodes[i]) == IS_OBJECT) {
131-
const zend_class_entry *ce = Z_OBJCE(nodes[i]);
132-
133-
if (instanceof_function(ce, dom_node_class_entry)) {
134-
if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) {
135-
return true;
136-
}
131+
if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) {
132+
return true;
137133
}
138134
}
139135
}

0 commit comments

Comments
 (0)