From c8a191d2968fe2ed61302e35675f449317435150 Mon Sep 17 00:00:00 2001 From: jubilant-enigma <54286000+jubilant-enigma@users.noreply.github.com> Date: Mon, 6 Dec 2021 10:18:14 -0800 Subject: [PATCH] Update src/ImageSharp/Formats/Png/PngDecoderCore.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Günther Foidl --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 042bcb92b6..6db2328f58 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -115,7 +115,8 @@ namespace SixLabors.ImageSharp.Formats.Png /// /// "Exif" and two zero bytes. Used for the legacy exif parsing. /// - private static readonly byte[] ExifHeader = new byte[] { 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 }; + // This uses C# compiler's optimization to refer to the static data directly, no intermediate array allocations happen. + private static ReadOnlySpan ExifHeader => new byte[] { 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 }; /// /// Initializes a new instance of the class.