Simplified code by radarhere · Pull Request #8235 · python-pillow/Pillow
Navigation Menu
{{ message }}
python-pillow / Pillow Public
- Notifications You must be signed in to change notification settings
- Fork 2.4k
Merged
hugovk merged 1 commit intopython-pillow:mainfrom
Jul 15, 2024Merged
Simplified code#8235
hugovk merged 1 commit intopython-pillow:mainfrom
Simplified code#8235
hugovk merged 1 commit intopython-pillow:mainfrom
Conversation
Copy link Copy Markdown
Member
radarhere
commented
Jul 15, 2024
radarhere
commented
#8216 has changed the code to return early if axis_name is NULL.
Lines 1311 to 1319 in 6944e9e
| axis_name = Py_BuildValue("y#", name.string, name.string_len); | |
| if (axis_name == NULL) { | |
| Py_DECREF(list_axis); | |
| Py_DECREF(list_axes); | |
| FT_Done_MM_Var(library, master); | |
| return NULL; | |
| } | |
| PyDict_SetItemString( | |
| list_axis, "name", axis_name ? axis_name : Py_None); |
So the ternary condition can be removed.
radarhere
added
the
Cleanup
label
lysnikolaou approved these changes Jul 15, 2024
Copy link Copy Markdown
Contributor
lysnikolaou
left a comment
lysnikolaou
left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I missed this while working on this part of the code. Thanks for noticing!
hugovk
merged commit
2152a17
into
python-pillow:main
radarhere
deleted the
axis_name
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment