1
0
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:
Niels Dossche
2024-05-29 19:50:41 +02:00
committed by GitHub
parent 8a87206211
commit 5db05955c8
6 changed files with 4 additions and 25 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 {

View File

@@ -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);

View File

@@ -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);