Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit587483d

Browse files
committed
Re-assign filteredEntityList as charStack grows.
There's no way entities that failed to match the prefix will match infuture, so remove them. 6% perf gain parsing the spec.
1 parentf0e5df5 commit587483d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎html5lib/tokenizer.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ def consumeEntity(self, allowedChar=None, fromAttribute=False):
184184
defentitiesStartingWith(name):
185185
return [eforeinfilteredEntityListife.startswith(name)]
186186

187-
while (charStack[-1]isnotEOFand
188-
entitiesStartingWith("".join(charStack))):
187+
while (charStack[-1]isnotEOF):
188+
filteredEntityList=entitiesStartingWith(u"".join(charStack))
189+
ifnotfilteredEntityList:
190+
break
189191
charStack.append(self.stream.char())
190192

191193
# At this point we have a string that starts with some characters

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp