mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
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.
This commit is contained in:
@@ -128,12 +128,8 @@ static bool dom_is_node_in_list(const zval *nodes, uint32_t nodesc, const xmlNod
|
||||
{
|
||||
for (uint32_t i = 0; i < nodesc; i++) {
|
||||
if (Z_TYPE(nodes[i]) == IS_OBJECT) {
|
||||
const zend_class_entry *ce = Z_OBJCE(nodes[i]);
|
||||
|
||||
if (instanceof_function(ce, dom_node_class_entry)) {
|
||||
if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) {
|
||||
return true;
|
||||
}
|
||||
if (dom_object_get_node(Z_DOMOBJ_P(nodes + i)) == node_to_find) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user