From 9f854f2c75558421c7a6751644bbb00404a4a7fb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 16 Jan 2017 16:53:40 +1100 Subject: [PATCH] Remove unnecessary casts --- src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs b/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs index fa1b76e696..79c40a6c84 100644 --- a/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs @@ -514,12 +514,11 @@ namespace ImageSharp.Formats if (errorCode == ErrorCodes.NoError) { - ushort v = - huffmanTree.Lut[(this.Bits.Accumulator >> (this.Bits.UnreadBits - HuffmanTree.LutSize)) & 0xff]; + ushort v = huffmanTree.Lut[(this.Bits.Accumulator >> (this.Bits.UnreadBits - HuffmanTree.LutSize)) & 0xFF]; if (v != 0) { - byte n = (byte)((v & 0xff) - 1); + int n = (v & 0xFF) - 1; this.Bits.UnreadBits -= n; this.Bits.Mask >>= n; return (byte)(v >> 8); @@ -1129,7 +1128,7 @@ namespace ImageSharp.Formats remaining--; byte x = this.ReadByte(); - byte tq = (byte)(x & 0x0f); + int tq = x & 0x0F; if (tq > MaxTq) { throw new ImageFormatException("Bad Tq value");