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

Commitf000f56

Browse files
committed
Made charsUntil a little bit faster when matching extremely short strings
--HG--extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401242
1 parentce43212 commitf000f56

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/html5lib/inputstream.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,13 @@ def charsUntil(self, characters, opposite = False):
337337
regex=u"".join([u"\\x%02x"%ord(c)forcincharacters])
338338
ifnotopposite:
339339
regex=u"^%s"%regex
340-
chars=charsUntilRegEx[(characters,opposite)]=re.compile(u"[%s]*"%regex)
340+
chars=charsUntilRegEx[(characters,opposite)]=re.compile(u"[%s]+"%regex)
341341

342342
whileTrue:
343343
# Find the longest matching prefix
344344
m=chars.match(self.chunk,self.chunkOffset)
345+
ifmisNone:
346+
break
345347
# If not everything matched, return everything up to the part that didn't match
346348
end=m.end()
347349
ifend!=self.chunkSize:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp