From ef49b377cd00644ff832c223e7e706a123e3b32b Mon Sep 17 00:00:00 2001 From: luuk Date: Thu, 1 Dec 2016 15:34:09 +0100 Subject: [PATCH] Array.Clear is faster and looks nicer in source --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 84909e0488..91578aede6 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -340,10 +340,7 @@ namespace ImageSharp.Formats byte[] scanline = ArrayPool.Shared.Rent(this.bytesPerScanline); // Zero out the previousScanline, because the bytes that are rented from the arraypool may not be zero. - for (var i = 0; i < bytesPerScanline; i++) - { - previousScanline[i] = 0x00; - } + Array.Clear(previousScanline, 0, this.bytesPerScanline); try {