Skip to content

Commit acc281c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d8012b3 commit acc281c

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

src/_imaging.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3851,10 +3851,8 @@ _compare_pixels(
38513851
// Fortunately, all of the modes that have extra bytes in their pixels
38523852
// use four bytes for their pixels.
38533853
UINT32 mask = 0xffffffff;
3854-
if (
3855-
!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") ||
3856-
!strcmp(mode, "HSV") || !strcmp(mode, "LAB")
3857-
) {
3854+
if (!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") || !strcmp(mode, "HSV") ||
3855+
!strcmp(mode, "LAB")) {
38583856
// These modes have three channels in four bytes,
38593857
// so we have to ignore the last byte.
38603858
#ifdef WORDS_BIGENDIAN
@@ -3908,11 +3906,8 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
39083906
const Imaging img_a = self->image;
39093907
const Imaging img_b = ((ImagingObject *)other)->image;
39103908

3911-
if (
3912-
strcmp(img_a->mode, img_b->mode)
3913-
|| img_a->xsize != img_b->xsize
3914-
|| img_a->ysize != img_b->ysize
3915-
) {
3909+
if (strcmp(img_a->mode, img_b->mode) || img_a->xsize != img_b->xsize ||
3910+
img_a->ysize != img_b->ysize) {
39163911
if (op == Py_EQ) {
39173912
Py_RETURN_FALSE;
39183913
} else {
@@ -3927,18 +3922,15 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
39273922
const UINT8 *palette_b_data = palette_b->palette;
39283923
const UINT8 **palette_a_data_ptr = &palette_a_data;
39293924
const UINT8 **palette_b_data_ptr = &palette_b_data;
3930-
if (
3931-
!palette_a || !palette_b
3932-
|| palette_a->size != palette_b->size
3933-
|| strcmp(palette_a->mode, palette_b->mode)
3934-
|| _compare_pixels(
3925+
if (!palette_a || !palette_b || palette_a->size != palette_b->size ||
3926+
strcmp(palette_a->mode, palette_b->mode) ||
3927+
_compare_pixels(
39353928
palette_a->mode,
39363929
1,
39373930
palette_a->size * 4,
39383931
palette_a_data_ptr,
39393932
palette_b_data_ptr
3940-
)
3941-
) {
3933+
)) {
39423934
if (op == Py_EQ) {
39433935
Py_RETURN_FALSE;
39443936
} else {
@@ -3953,8 +3945,7 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
39533945
img_a->linesize,
39543946
(const UINT8 **)img_a->image,
39553947
(const UINT8 **)img_b->image
3956-
)
3957-
) {
3948+
)) {
39583949
if (op == Py_EQ) {
39593950
Py_RETURN_FALSE;
39603951
} else {

0 commit comments

Comments
 (0)