From 10435a3bd9c721cae576faf300cca8964b09b0d2 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Wed, 18 Apr 2018 12:16:42 -0700 Subject: [PATCH] Remove unused PackField methods --- src/ImageSharp/Formats/Gif/PackedField.cs | 64 +---------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/src/ImageSharp/Formats/Gif/PackedField.cs b/src/ImageSharp/Formats/Gif/PackedField.cs index 0d3b1539c3..e3c1ef0e75 100644 --- a/src/ImageSharp/Formats/Gif/PackedField.cs +++ b/src/ImageSharp/Formats/Gif/PackedField.cs @@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp.Formats.Gif /// Represents a byte of data in a GIF data stream which contains a number /// of data items. /// - internal readonly struct PackedField : IEquatable + internal readonly struct PackedField { /// /// The individual bits representing the packed byte. @@ -48,19 +48,6 @@ namespace SixLabors.ImageSharp.Formats.Gif } } - /// - /// Returns a new with the bits in the packed fields to - /// the corresponding bits from the supplied byte. - /// - /// The value to pack. - /// The - public static PackedField FromInt(byte value) - { - PackedField packed = default; - packed.SetBits(0, 8, value); - return packed; - } - /// /// Sets the specified bit within the packed fields to the supplied /// value. @@ -113,55 +100,6 @@ namespace SixLabors.ImageSharp.Formats.Gif return Bits[index]; } - /// - /// Gets the value of the specified bits within the byte. - /// - /// The zero-based index of the first bit to get. - /// The number of bits to get. - /// - /// The value of the specified bits within the byte. - /// - public int GetBits(int startIndex, int length) - { - DebugGuard.MustBeBetweenOrEqualTo(startIndex, 1, 8, nameof(startIndex)); - DebugCheckLength(startIndex, length); - - int returnValue = 0; - int bitShift = length - 1; - for (int i = startIndex; i < startIndex + length; i++) - { - int bitValue = (Bits[i] ? 1 : 0) << bitShift; - returnValue += bitValue; - bitShift--; - } - - return returnValue; - } - - /// - public override bool Equals(object obj) - { - return obj is PackedField other && this.Equals(other); - } - - /// - public bool Equals(PackedField other) - { - return this.Byte.Equals(other.Byte); - } - - /// - public override string ToString() - { - return $"PackedField [ Byte={this.Byte} ]"; - } - - /// - public override int GetHashCode() - { - return this.Byte.GetHashCode(); - } - [Conditional("DEBUG")] private static void DebugCheckLength(int startIndex, int length) {