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

Commitf1b28b0

Browse files
committed
Avoid allocating bytes slice in encoding pre-parse
1 parent0db23a3 commitf1b28b0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

‎html5lib/_inputstream.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,7 @@ def matchBytes(self, bytes):
658658
"""Look for a sequence of bytes at the start of a string. If the bytes
659659
are found return True and advance the position to the byte after the
660660
match. Otherwise return False and leave the position alone"""
661-
p=self.position
662-
data=self[p:p+len(bytes)]
663-
rv=data.startswith(bytes)
661+
rv=self.startswith(bytes,self.position)
664662
ifrv:
665663
self.position+=len(bytes)
666664
returnrv

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp