Skip to content
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

simplify implementation of Py::clone_ref #4313

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

davidhewitt
Copy link
Member

Just browsing source and felt that this alternative implementation is simpler for the optimizer to inline away. (Should ultimately reach the same machine code either way.)

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Jul 5, 2024
@alex
Copy link
Contributor

alex commented Jul 5, 2024

I'm ambivalent on this, if you think it's cleaner that's fine.

@davidhewitt
Copy link
Member Author

Agreed it's very minor; I just feel that Py::from_borrowed_ptr (which itself recurses into Py::from_borrowed_ptr_or_opt and introduces a panic that will never be reached in this case) produces a lot more stuff which needs to be removed in dead code elimination.

@davidhewitt davidhewitt added this pull request to the merge queue Jul 7, 2024
Merged via the queue into PyO3:main with commit d5c886f Jul 7, 2024
41 of 42 checks passed
@davidhewitt davidhewitt deleted the clone-ref branch July 7, 2024 07:36
davidhewitt added a commit that referenced this pull request Jul 10, 2024
davidhewitt added a commit that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants