From 1f483f07caa5d7d0820dc11dd5dfe4a602ca37e4 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 11 May 2021 01:36:16 -0400 Subject: [PATCH] chore: remove an unneeded xmlSetNs-after-reparent call The function `reparent_node_with` is already doing the right thing. --- ext/nokogiri/xml_node.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ext/nokogiri/xml_node.c b/ext/nokogiri/xml_node.c index 02d8588ca2..849a1402f4 100644 --- a/ext/nokogiri/xml_node.c +++ b/ext/nokogiri/xml_node.c @@ -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;