mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Move more common code into php_dom_next_in_tree_order() (#14363)
This commit is contained in:
@@ -1023,11 +1023,6 @@ static void dom_remove_eliminated_ns(xmlNodePtr node, xmlNsPtr eliminatedNs)
|
||||
|
||||
if (node->type == XML_ELEMENT_NODE) {
|
||||
dom_remove_eliminated_ns_single_element(node, eliminatedNs);
|
||||
|
||||
if (node->children) {
|
||||
node = node->children;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
node = php_dom_next_in_tree_order(node, base);
|
||||
|
||||
@@ -439,11 +439,6 @@ PHP_DOM_EXPORT void php_dom_libxml_reconcile_modern(php_dom_libxml_ns_mapper *ns
|
||||
|
||||
if (node->type == XML_ELEMENT_NODE) {
|
||||
php_dom_libxml_reconcile_modern_single_element_node(&ctx, node);
|
||||
|
||||
if (node->children) {
|
||||
node = node->children;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
node = php_dom_next_in_tree_order(node, base);
|
||||
|
||||
@@ -1762,11 +1762,6 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr basep, xmlNodePtr nodep,
|
||||
(*cur)++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nodep->children) {
|
||||
nodep = nodep->children;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
nodep = php_dom_next_in_tree_order(nodep, basep);
|
||||
|
||||
@@ -91,6 +91,10 @@ static zend_always_inline php_dom_libxml_ns_mapper *php_dom_get_ns_mapper(dom_ob
|
||||
|
||||
static zend_always_inline xmlNodePtr php_dom_next_in_tree_order(const xmlNode *nodep, const xmlNode *basep)
|
||||
{
|
||||
if (nodep->type == XML_ELEMENT_NODE && nodep->children) {
|
||||
return nodep->children;
|
||||
}
|
||||
|
||||
if (nodep->next) {
|
||||
return nodep->next;
|
||||
} else {
|
||||
|
||||
@@ -77,11 +77,6 @@ static void dom_mark_namespaces_as_attributes_too(php_dom_libxml_ns_mapper *ns_m
|
||||
while (node != NULL) {
|
||||
if (node->type == XML_ELEMENT_NODE) {
|
||||
php_dom_ns_compat_mark_attribute_list(ns_mapper, node);
|
||||
|
||||
if (node->children) {
|
||||
node = node->children;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
node = php_dom_next_in_tree_order(node, NULL);
|
||||
|
||||
@@ -155,11 +155,6 @@ static void xsl_build_ns_map(xmlHashTablePtr table, xsltStylesheetPtr sheet, php
|
||||
xsl_add_ns_to_map(table, sheet, cur, prefix, ns->href);
|
||||
}
|
||||
}
|
||||
|
||||
if (cur->children != NULL) {
|
||||
cur = cur->children;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
cur = php_dom_next_in_tree_order(cur, (const xmlNode *) doc);
|
||||
|
||||
Reference in New Issue
Block a user