Skip to content

gh-92088: Potential Performance Improvements #92084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Lib/_markupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,14 @@ def _parse_doctype_attlist(self, i, declstartpos):
return -1
if c == "(":
# an enumerated type; look for ')'
if ")" in rawdata[j:]:
j = rawdata.find(")", j) + 1
_temp = rawdata.find(")", j)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of _temp, consider closer_pos or something else similarly descriptive.

if _temp != -1:
j = _temp + 1
else:
return -1
while rawdata[j:j+1].isspace():
j = j + 1
if not rawdata[j:]:
if j >= len(rawdata):
# end of buffer, incomplete
return -1
else:
Expand Down