Skip to content

Commit 9792a78

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

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

src/_imaging.c

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,15 +3803,12 @@ _compare_pixels(
38033803
const int ysize,
38043804
const int linesize,
38053805
const UINT8 **pixels_a,
3806-
const UINT8 **pixels_b
3807-
) {
3806+
const UINT8 **pixels_b) {
38083807
// Fortunately, all of the modes that have extra bytes in their pixels
38093808
// use four bytes for their pixels.
38103809
UINT32 mask = 0xffffffff;
3811-
if (
3812-
!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") ||
3813-
!strcmp(mode, "HSV") || !strcmp(mode, "LAB")
3814-
) {
3810+
if (!strcmp(mode, "RGB") || !strcmp(mode, "YCbCr") || !strcmp(mode, "HSV") ||
3811+
!strcmp(mode, "LAB")) {
38153812
// These modes have three channels in four bytes,
38163813
// so we have to ignore the last byte.
38173814
#ifdef WORDS_BIGENDIAN
@@ -3865,11 +3862,8 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
38653862
const Imaging img_a = self->image;
38663863
const Imaging img_b = ((ImagingObject *)other)->image;
38673864

3868-
if (
3869-
strcmp(img_a->mode, img_b->mode)
3870-
|| img_a->xsize != img_b->xsize
3871-
|| img_a->ysize != img_b->ysize
3872-
) {
3865+
if (strcmp(img_a->mode, img_b->mode) || img_a->xsize != img_b->xsize ||
3866+
img_a->ysize != img_b->ysize) {
38733867
if (op == Py_EQ) {
38743868
Py_RETURN_FALSE;
38753869
} else {
@@ -3884,18 +3878,14 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
38843878
const UINT8 *palette_b_data = palette_b->palette;
38853879
const UINT8 **palette_a_data_ptr = &palette_a_data;
38863880
const UINT8 **palette_b_data_ptr = &palette_b_data;
3887-
if (
3888-
!palette_a || !palette_b
3889-
|| palette_a->size != palette_b->size
3890-
|| strcmp(palette_a->mode, palette_b->mode)
3891-
|| _compare_pixels(
3881+
if (!palette_a || !palette_b || palette_a->size != palette_b->size ||
3882+
strcmp(palette_a->mode, palette_b->mode) ||
3883+
_compare_pixels(
38923884
palette_a->mode,
38933885
1,
38943886
palette_a->size * 4,
38953887
palette_a_data_ptr,
3896-
palette_b_data_ptr
3897-
)
3898-
) {
3888+
palette_b_data_ptr)) {
38993889
if (op == Py_EQ) {
39003890
Py_RETURN_FALSE;
39013891
} else {
@@ -3909,9 +3899,7 @@ image_richcompare(const ImagingObject *self, const PyObject *other, const int op
39093899
img_a->ysize,
39103900
img_a->linesize,
39113901
(const UINT8 **)img_a->image,
3912-
(const UINT8 **)img_b->image
3913-
)
3914-
) {
3902+
(const UINT8 **)img_b->image)) {
39153903
if (op == Py_EQ) {
39163904
Py_RETURN_FALSE;
39173905
} else {

0 commit comments

Comments
 (0)