Skip to content

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

Closed
WolframAlph wants to merge 1 commit intopython:mainfrom
WolframAlph:remove-memset
Closed

gh-130080: Remove unnecessary memset for _PyASTOptimizeState initializing #131745
WolframAlph wants to merge 1 commit intopython:mainfrom
WolframAlph:remove-memset

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