Skip to content

Move more common code into php_dom_next_in_tree_order() #14363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ext/dom/element.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions ext/dom/namespace_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions ext/dom/php_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions ext/dom/xml_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 0 additions & 5 deletions ext/dom/xml_document.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions ext/xsl/xsltprocessor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading