Project

General

Profile

« Previous | Next » 

Revision 115

xml_func.py: Added optimization to first check if function name starts with _ before looking it up in the table

View differences:

xml_func.py
53 53
def process(doc, node=None):
54 54
    if node == None: node = doc.documentElement
55 55
    name = xml_dom.name_of(node)
56
    if name in funcs: xml_dom.replace_with_text(doc, node,
57
        funcs[name](xml_dom.NodeTextEntryIter(node)))
56
    if name.startswith('_') and name in funcs: xml_dom.replace_with_text(doc,
57
        node, funcs[name](xml_dom.NodeTextEntryIter(node)))
58 58
    else:
59 59
        for child in xml_dom.NodeElemIter(node): process(doc, child)

Also available in: Unified diff