From d8db6539d507486e93b13bbcad12150e8bc817a4 Mon Sep 17 00:00:00 2001 From: Brian Popow <38701097+brianpopow@users.noreply.github.com> Date: Sat, 15 Jan 2022 16:11:30 +0100 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Günther Foidl --- src/ImageSharp/Formats/Webp/AlphaDecoder.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ImageSharp/Formats/Webp/AlphaDecoder.cs b/src/ImageSharp/Formats/Webp/AlphaDecoder.cs index 39ff0dbbb4..24104369ee 100644 --- a/src/ImageSharp/Formats/Webp/AlphaDecoder.cs +++ b/src/ImageSharp/Formats/Webp/AlphaDecoder.cs @@ -314,14 +314,14 @@ namespace SixLabors.ImageSharp.Formats.Webp #if SUPPORTS_RUNTIME_INTRINSICS if (Sse2.IsSupported) { - dst[0] = (byte)(input[0] + (prev == null ? 0 : prev[0])); + dst[0] = (byte)(input[0] + (prev.IsEmpty ? 0 : prev[0])); if (width <= 1) { return; } - int i; - var last = Vector128.Create(dst[0], 0, 0, 0); + nint i; + var last = Vector128.Zero.WithElement(0, dst[0]); ref byte srcRef = ref MemoryMarshal.GetReference(input); for (i = 1; i + 8 <= width; i += 8) { @@ -347,7 +347,7 @@ namespace SixLabors.ImageSharp.Formats.Webp else #endif { - byte pred = (byte)(prev == null ? 0 : prev[0]); + byte pred = (byte)(prev.IsEmpty ? 0 : prev[0]); for (int i = 0; i < width; i++) { @@ -369,7 +369,7 @@ namespace SixLabors.ImageSharp.Formats.Webp #if SUPPORTS_RUNTIME_INTRINSICS if (Avx2.IsSupported) { - int i; + nint i; int maxPos = width & ~31; for (i = 0; i < maxPos; i += 32) {