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

Commit22886b1

Browse files
committed
Fixed recent regression of recent minor charsUntil optimisation
--HG--extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401245
1 parentc6f0940 commit22886b1

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎src/html5lib/inputstream.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,20 @@ def charsUntil(self, characters, opposite = False):
343343
# Find the longest matching prefix
344344
m=chars.match(self.chunk,self.chunkOffset)
345345
ifmisNone:
346-
end=self.chunkOffset
346+
# If nothing matched, and it wasn't because we ran out of chunk,
347+
# then stop
348+
ifself.chunkOffset!=self.chunkSize:
349+
break
347350
else:
348351
end=m.end()
349-
# If not everything matched, return everything up to the part that didn't match
350-
ifend!=self.chunkSize:
351-
rv.append(self.chunk[self.chunkOffset:end])
352-
self.chunkOffset=end
353-
break
354-
# If the whole chunk matched, use it all and read the next chunk
352+
# If not the whole chunk matched, return everything
353+
# up to the part that didn't match
354+
ifend!=self.chunkSize:
355+
rv.append(self.chunk[self.chunkOffset:end])
356+
self.chunkOffset=end
357+
break
358+
# If the whole remainder of the chunk matched,
359+
# use it all and read the next chunk
355360
rv.append(self.chunk[self.chunkOffset:])
356361
ifnotself.readChunk():
357362
# Reached EOF

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp