Skip to content

Commit 8f81243

Browse files
committed
optimize InCellPhase a little; saves about 665 * 2 invocations for web-apps.htm
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40357
1 parent 26cc94d commit 8f81243

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/parser.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,10 @@ def startTagTableOther(self, name, attributes):
16171617

16181618
def startTagOther(self, name, attributes):
16191619
self.parser.phases["inBody"].processStartTag(name, attributes)
1620+
# Optimize this for subsequent invocations. Can't do this initially
1621+
# because self.phases doesn't really exist at that point.
1622+
self.startTagHandler.default =\
1623+
self.parser.phases["inBody"].processStartTag
16201624

16211625
def endTagTableCell(self, name):
16221626
if self.parser.elementInScope(name, True):
@@ -1647,6 +1651,9 @@ def endTagImply(self, name):
16471651

16481652
def endTagOther(self, name):
16491653
self.parser.phases["inBody"].processEndTag(name)
1654+
# Optimize this for subsequent invocations. Can't do this initially
1655+
# because self.phases doesn't really exist at that point.
1656+
self.endTagHandler.default = self.parser.phases["inBody"].processEndTag
16501657

16511658

16521659
class InSelectPhase(Phase):

0 commit comments

Comments
 (0)