From 20b0349455d4918f304e63c6863673c07fcb8a1f Mon Sep 17 00:00:00 2001 From: Ynse Hoornenborg Date: Sat, 4 Dec 2021 21:08:29 +0100 Subject: [PATCH] NeedsUpscaling code improvements --- src/ImageSharp/Formats/Pbm/PbmDecoderCore.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/ImageSharp/Formats/Pbm/PbmDecoderCore.cs b/src/ImageSharp/Formats/Pbm/PbmDecoderCore.cs index 427ea15e8c..1aeecc16ff 100644 --- a/src/ImageSharp/Formats/Pbm/PbmDecoderCore.cs +++ b/src/ImageSharp/Formats/Pbm/PbmDecoderCore.cs @@ -53,22 +53,7 @@ namespace SixLabors.ImageSharp.Formats.Pbm /// Size IImageDecoderInternals.Dimensions => this.PixelSize; - private bool NeedsUpscaling - { - get - { - bool needsUpscaling = false; - if (this.ColorType != PbmColorType.BlackAndWhite) - { - if (this.MaxPixelValue is not 255 and not 65535) - { - needsUpscaling = true; - } - } - - return needsUpscaling; - } - } + private bool NeedsUpscaling => this.ColorType != PbmColorType.BlackAndWhite && this.MaxPixelValue is not 255 and not 65535; /// public Image Decode(BufferedReadStream stream, CancellationToken cancellationToken)