Skip to content

Optimize _Py_strhex_impl() #19535

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

Merged
merged 1 commit into from
Apr 15, 2020
Merged

Optimize _Py_strhex_impl() #19535

merged 1 commit into from
Apr 15, 2020

Conversation

vstinner
Copy link
Member

Avoid a temporary buffer to create a bytes string: use
PyBytes_FromStringAndSize() to directly allocate a bytes object.

Cleanup also the code: PEP 7 formatting, move variable definitions
closer to where they are used.

Avoid a temporary buffer to create a bytes string: use
PyBytes_FromStringAndSize() to directly allocate a bytes object.

Cleanup also the code: PEP 7 formatting, move variable definitions
closer to where they are used.
@vstinner vstinner merged commit 455df97 into python:master Apr 15, 2020
@vstinner vstinner deleted the strhex branch April 15, 2020 12:05
@vstinner
Copy link
Member Author

Oh, thanks @methane for the review. I wasn't comfortable with my PR since I made unrelated changes, like fixing the assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants