From d2f6a8534f54aa140d8f32fdc13274c6de83ce5d Mon Sep 17 00:00:00 2001 From: JimBobSquarePants Date: Fri, 22 Sep 2017 15:02:12 +1000 Subject: [PATCH] Minor cleanup tweaks --- .../Jpeg/GolangPort/Components/Decoder/Bits.cs | 8 +++----- .../Jpeg/GolangPort/Components/Decoder/Bytes.cs | 11 +++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs index acaa69e3ac..05bde78e65 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bits.cs @@ -92,8 +92,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder [MethodImpl(MethodImplOptions.AggressiveInlining)] public int ReceiveExtend(int t, ref InputProcessor inputProcessor) { - int x; - OrigDecoderErrorCode errorCode = this.ReceiveExtendUnsafe(t, ref inputProcessor, out x); + OrigDecoderErrorCode errorCode = this.ReceiveExtendUnsafe(t, ref inputProcessor, out int x); errorCode.EnsureNoError(); return x; } @@ -120,7 +119,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder this.UnreadBits -= t; this.Mask >>= t; int s = 1 << t; - x = (int)((this.Accumulator >> this.UnreadBits) & (s - 1)); + x = (this.Accumulator >> this.UnreadBits) & (s - 1); if (x < (s >> 1)) { @@ -132,8 +131,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder private OrigDecoderErrorCode EnsureBitsStepImpl(ref InputProcessor inputProcessor) { - int c; - OrigDecoderErrorCode errorCode = inputProcessor.Bytes.ReadByteStuffedByteUnsafe(inputProcessor.InputStream, out c); + OrigDecoderErrorCode errorCode = inputProcessor.Bytes.ReadByteStuffedByteUnsafe(inputProcessor.InputStream, out int c); if (errorCode != OrigDecoderErrorCode.NoError) { diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs index b8c64fbe4c..38507d58c8 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/Bytes.cs @@ -59,10 +59,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder public static Bytes Create() { return new Bytes - { - Buffer = BytePool.Rent(BufferSize), - BufferAsInt = IntPool.Rent(BufferSize) - }; + { + Buffer = BytePool.Rent(BufferSize), + BufferAsInt = IntPool.Rent(BufferSize) + }; } /// @@ -148,8 +148,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder [MethodImpl(MethodImplOptions.AggressiveInlining)] public byte ReadByte(Stream inputStream) { - byte result; - OrigDecoderErrorCode errorCode = this.ReadByteUnsafe(inputStream, out result); + OrigDecoderErrorCode errorCode = this.ReadByteUnsafe(inputStream, out byte result); errorCode.EnsureNoError(); return result; }