Skip to content

Simplified code#8235

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:axis_name
Jul 15, 2024
Merged

Simplified code#8235
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:axis_name

Conversation

@radarhere
Copy link
Copy Markdown
Member

#8216 has changed the code to return early if axis_name is NULL.

Pillow/src/_imagingft.c

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.

Copy link
Copy Markdown
Contributor

@lysnikolaou 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 hugovk merged commit 2152a17 into python-pillow:main Jul 15, 2024
@radarhere radarhere deleted the axis_name branch July 15, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants