Skip to content

Commit 56ed83e

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

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
@@ -3804,10 +3804,8 @@ _compare_pixels(
38043804
// Fortunately, all of the modes that have extra bytes in their pixels
38053805
// use four bytes for their pixels.
38063806
UINT32 mask = 0xffffffff;
3807-
if (
3808-
!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") ||
3809-
!strcmp(mode, "HSV") || !strcmp(mode, "LAB")
3810-
) {
3807+
if (!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") || !strcmp(mode, "HSV") ||
3808+
!strcmp(mode, "LAB")) {
38113809
// These modes have three channels in four bytes,
38123810
// so we have to ignore the last byte.
38133811
#ifdef WORDS_BIGENDIAN
@@ -3861,11 +3859,8 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
38613859
const Imaging img_a = self->image;
38623860
const Imaging img_b = ((ImagingObject *)other)->image;
38633861

3864-
if (
3865-
strcmp(img_a->mode, img_b->mode)
3866-
|| img_a->xsize != img_b->xsize
3867-
|| img_a->ysize != img_b->ysize
3868-
) {
3862+
if (strcmp(img_a->mode, img_b->mode) || img_a->xsize != img_b->xsize ||
3863+
img_a->ysize != img_b->ysize) {
38693864
if (op == Py_EQ) {
38703865
Py_RETURN_FALSE;
38713866
} else {
@@ -3880,18 +3875,15 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
38803875
const UINT8 *palette_b_data = palette_b->palette;
38813876
const UINT8 **palette_a_data_ptr = &palette_a_data;
38823877
const UINT8 **palette_b_data_ptr = &palette_b_data;
3883-
if (
3884-
!palette_a || !palette_b
3885-
|| palette_a->size != palette_b->size
3886-
|| strcmp(palette_a->mode, palette_b->mode)
3887-
|| _compare_pixels(
3878+
if (!palette_a || !palette_b || palette_a->size != palette_b->size ||
3879+
strcmp(palette_a->mode, palette_b->mode) ||
3880+
_compare_pixels(
38883881
palette_a->mode,
38893882
1,
38903883
palette_a->size * 4,
38913884
palette_a_data_ptr,
38923885
palette_b_data_ptr
3893-
)
3894-
) {
3886+
)) {
38953887
if (op == Py_EQ) {
38963888
Py_RETURN_FALSE;
38973889
} else {
@@ -3906,8 +3898,7 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
39063898
img_a->linesize,
39073899
(const UINT8 **)img_a->image,
39083900
(const UINT8 **)img_b->image
3909-
)
3910-
) {
3901+
)) {
39113902
if (op == Py_EQ) {
39123903
Py_RETURN_FALSE;
39133904
} else {

0 commit comments

Comments
 (0)