Skip to content

gh-130080: Remove unnecessary memset for _PyASTOptimizeState initializing #131745

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

Closed
wants to merge 1 commit into from

Conversation

WolframAlph
Copy link
Contributor

@WolframAlph WolframAlph commented Mar 25, 2025

I believe this memset is unnecessary as all of the struct fields (except for cf_finally_used) are initialized explicitly anyway. Therefore removing it and initializing cf_finally_used explicitly as well.

@iritkatriel
Copy link
Member

We do this in other places - set everything to 0 and then override other fields. If someone adds a new field which should be initialised to 0 they will probably not bother to update initialisation.

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.

3 participants