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

Simplified code #8235

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Simplified code #8235

merged 1 commit into from
Jul 15, 2024

Conversation

radarhere
Copy link
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
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
50 of 52 checks passed
@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