From f9c9a019d1ae0509cb85b3c63197b4bdff1db4be Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 3 Sep 2022 10:54:53 +0200 Subject: [PATCH] Removed unused argument. --- src/ImageSharp/Configuration.cs | 2 +- .../Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs | 4 ++-- .../PixelOperations/Rgb24.PixelOperations.cs | 2 -- .../PixelOperations/Rgba32.PixelOperations.cs | 2 -- src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs | 4 ---- .../PixelFormats/PixelOperations/PixelOperationsTests.cs | 2 +- 6 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index ea1c4eea23..76c2b31b38 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -70,7 +70,7 @@ namespace SixLabors.ImageSharp get => this.maxDegreeOfParallelism; set { - if (value == 0 || value < -1) + if (value is 0 or < -1) { throw new ArgumentOutOfRangeException(nameof(this.MaxDegreeOfParallelism)); } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs index 985c457158..938815daea 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs @@ -155,12 +155,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder // pack pixels to a temporary, padded proxy buffer, then copy the relevant values to the destination row. if (this.pixelBuffer.DangerousTryGetPaddedRowSpan(yy, 3, out Span destRow)) { - PixelOperations.Instance.PackFromRgbPlanes(this.configuration, r, g, b, destRow); + PixelOperations.Instance.PackFromRgbPlanes(r, g, b, destRow); } else { Span proxyRow = this.paddedProxyPixelRow.GetSpan(); - PixelOperations.Instance.PackFromRgbPlanes(this.configuration, r, g, b, proxyRow); + PixelOperations.Instance.PackFromRgbPlanes(r, g, b, proxyRow); proxyRow[..width].CopyTo(this.pixelBuffer.DangerousGetRowSpan(yy)); } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs index c4b84dca32..50ea3533bf 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs @@ -24,13 +24,11 @@ namespace SixLabors.ImageSharp.PixelFormats /// internal override void PackFromRgbPlanes( - Configuration configuration, ReadOnlySpan redChannel, ReadOnlySpan greenChannel, ReadOnlySpan blueChannel, Span destination) { - Guard.NotNull(configuration, nameof(configuration)); int count = redChannel.Length; GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count); diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs index 98d9177a98..ed3a53758b 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs @@ -59,13 +59,11 @@ namespace SixLabors.ImageSharp.PixelFormats /// internal override void PackFromRgbPlanes( - Configuration configuration, ReadOnlySpan redChannel, ReadOnlySpan greenChannel, ReadOnlySpan blueChannel, Span destination) { - Guard.NotNull(configuration, nameof(configuration)); int count = redChannel.Length; GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count); diff --git a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs index 4721a3748b..9d2a2f1b2d 100644 --- a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs @@ -166,20 +166,16 @@ namespace SixLabors.ImageSharp.PixelFormats /// Bulk operation that packs 3 seperate RGB channels to . /// The destination must have a padding of 3. /// - /// A to configure internal operations. /// A to the red values. /// A to the green values. /// A to the blue values. /// A to the destination pixels. internal virtual void PackFromRgbPlanes( - Configuration configuration, ReadOnlySpan redChannel, ReadOnlySpan greenChannel, ReadOnlySpan blueChannel, Span destination) { - Guard.NotNull(configuration, nameof(configuration)); - int count = redChannel.Length; GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count); diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs index 3a6c04540b..6f11e7aecb 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs @@ -1057,7 +1057,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations public void PackFromRgbPlanes(int count) => SimdUtilsTests.TestPackFromRgbPlanes( count, - (r, g, b, actual) => PixelOperations.Instance.PackFromRgbPlanes(this.Configuration, r, g, b, actual)); + (r, g, b, actual) => PixelOperations.Instance.PackFromRgbPlanes(r, g, b, actual)); public delegate void RefAction(ref T1 arg1);