From 5b203b8ad3d9d7675325929c916d6fd6e40b3b8a Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 23 Jan 2017 05:28:28 +0100 Subject: [PATCH] minor refactor --- src/ImageSharp.Formats.Jpeg/Components/Decoder/Bytes.cs | 1 + src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp.Formats.Jpeg/Components/Decoder/Bytes.cs b/src/ImageSharp.Formats.Jpeg/Components/Decoder/Bytes.cs index b65df51dc4..50f8fd7f02 100644 --- a/src/ImageSharp.Formats.Jpeg/Components/Decoder/Bytes.cs +++ b/src/ImageSharp.Formats.Jpeg/Components/Decoder/Bytes.cs @@ -182,6 +182,7 @@ namespace ImageSharp.Formats.Jpg return errorCode; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public DecoderErrorCode ReadByteAsIntUnsafe(Stream inputStream, out int result) { DecoderErrorCode errorCode = DecoderErrorCode.NoError; diff --git a/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs b/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs index 64f19a3a29..cf39ad0e6e 100644 --- a/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs @@ -8,6 +8,7 @@ namespace ImageSharp.Formats using System.Buffers; using System.IO; using System.Runtime.CompilerServices; + using System.Runtime.InteropServices; using System.Threading.Tasks; using ImageSharp.Formats.Jpg; @@ -380,7 +381,6 @@ namespace ImageSharp.Formats if (code <= huffmanTree.MaxCodes[i]) { - // ValuesAsInt[huffmanTree.Indices[i] + code - huffmanTree.MinCodes[i]]; result = huffmanTree.GetValue(code, i); return DecoderErrorCode.NoError; }