Skip to content

Commit

Permalink
chore: remove an unneeded xmlSetNs-after-reparent call
Browse files Browse the repository at this point in the history
The function `reparent_node_with` is already doing the right thing.
  • Loading branch information
flavorjones committed May 11, 2021
1 parent 8f69859 commit 1f483f0
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions ext/nokogiri/xml_node.c
Expand Up @@ -69,11 +69,6 @@ relink_namespace(xmlNodePtr reparented)
/* Avoid segv when relinking against unlinked nodes. */
if (reparented->type != XML_ELEMENT_NODE || !reparented->parent) { return; }

/* Make sure that our reparented node has the correct namespaces */
if (!reparented->ns && reparented->doc != (xmlDocPtr)reparented->parent) {
xmlSetNs(reparented, reparented->parent->ns);
}

/* Search our parents for an existing definition */
if (reparented->nsDef) {
xmlNsPtr curr = reparented->nsDef;
Expand Down

0 comments on commit 1f483f0

Please sign in to comment.