Combined conditions by radarhere · Pull Request #8011 · python-pillow/Pillow

Comment on lines 222 to 224

} else if (strcmp(PILmode, "RGBA;16B") == 0) {
return TYPE_RGBA_16;
} else if (strcmp(PILmode, "CMYK") == 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a style issue: these all return, I think it reads a little cleaner to remove the elses:

} else if (strcmp(PILmode, "RGBA;16B") == 0) {
return TYPE_RGBA_16;
} else if (strcmp(PILmode, "CMYK") == 0) {
}
if (strcmp(PILmode, "RGBA;16B") == 0) {
return TYPE_RGBA_16;
}
if (strcmp(PILmode, "CMYK") == 0) {

etc.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've updated the commit.

// LabX equivalent like ALab, but not reversed -- no #define in lcms2
return (COLORSPACE_SH(PT_LabV2) | CHANNELS_SH(3) | BYTES_SH(1) | EXTRA_SH(1));
}
else {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And ditch and dedent this block?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I know what you meant, I've updated the commit.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, like that :)