Commit b2f7b8bb authored by Evan Simpson's avatar Evan Simpson

Short-circuit the common case of opening tags without AL markup. As a side...

Short-circuit the common case of opening tags without AL markup.  As a side effect, stop generating spurious setPosition directives that break code optimization.
parent 633669f1
...@@ -350,6 +350,14 @@ class TALGenerator: ...@@ -350,6 +350,14 @@ class TALGenerator:
def emitStartElement(self, name, attrlist, taldict, metaldict, def emitStartElement(self, name, attrlist, taldict, metaldict,
position=(None, None), isend=0): position=(None, None), isend=0):
if len(taldict) == len(metaldict) == 0:
# Handle the simple, common case
self.emitStartTag(name, attrlist, isend)
self.todoPush({})
if isend:
self.emitEndElement(name, isend)
return
for key in taldict.keys(): for key in taldict.keys():
if key not in KNOWN_TAL_ATTRIBUTES: if key not in KNOWN_TAL_ATTRIBUTES:
raise TALError("bad TAL attribute: " + `key`, position) raise TALError("bad TAL attribute: " + `key`, position)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment