Skip to content

Optimize _Py_strhex_impl()#19535

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:strhex
Apr 15, 2020
Merged

Optimize _Py_strhex_impl()#19535
vstinner merged 1 commit into
python:masterfrom
vstinner:strhex

Conversation

@vstinner

Copy link
Copy Markdown
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
Copy Markdown
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