[Lxml-checkins] r54445 - lxml/branch/lxml-2.0/src/lxml

scoder at codespeak.net scoder at codespeak.net
Mon May 5 21:31:00 CEST 2008


Author: scoder
Date: Mon May  5 21:30:57 2008
New Revision: 54445

Modified:
   lxml/branch/lxml-2.0/src/lxml/proxy.pxi
Log:
merged ns copy optimisation from trunk

Modified: lxml/branch/lxml-2.0/src/lxml/proxy.pxi
==============================================================================
--- lxml/branch/lxml-2.0/src/lxml/proxy.pxi	(original)
+++ lxml/branch/lxml-2.0/src/lxml/proxy.pxi	Mon May  5 21:30:57 2008
@@ -191,10 +191,8 @@
                                     c_parent.type == tree.XML_DOCUMENT_NODE):
         c_new_ns = c_parent.nsDef
         while c_new_ns is not NULL:
-            # check if prefix is already defined
-            c_ns = tree.xmlSearchNs(c_to_node.doc, c_to_node, c_new_ns.prefix)
-            if c_ns is NULL:
-                tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
+            # libxml2 will check if the prefix is already defined
+            tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
             c_new_ns = c_new_ns.next
         c_parent = c_parent.parent
 


More information about the lxml-checkins mailing list