From 389238fd4d44bbcdade078f620673487400ddc47 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Wed, 12 Nov 2025 08:37:09 +0100 Subject: [PATCH] Use if statements instead. --- coders/pnm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/coders/pnm.c b/coders/pnm.c index adce405bec..10c5f19c82 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -1964,15 +1964,10 @@ static MagickBooleanType WritePNMImage(const ImageInfo *image_info,Image *image, quantum_type=GetQuantumType(image,exception); if (quantum_type == IndexQuantum) { - switch (image->colorspace) - { - case CMYKColorspace: - quantum_type=CMYKQuantum; - break; - case GRAYColorspace: - quantum_type=GrayQuantum; - break; - } + if (image->colorspace == CMYKColorspace) + quantum_type=CMYKQuantum; + else if (image->colorspace == GRAYColorspace) + quantum_type=GrayQuantum; } switch (quantum_type) {