Browse Source

Use static fields. See if dll version fix CI 472 build

pull/1574/head
James Jackson-South 6 years ago
parent
commit
7dab97def3
  1. 6
      Directory.Build.targets
  2. 7
      src/ImageSharp/Formats/Png/Zlib/DeflaterHuffman.cs

6
Directory.Build.targets

@ -23,12 +23,12 @@
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />
<!--Src Dependencies-->
<PackageReference Update="System.Buffers" Version="4.5.1" />
<PackageReference Update="System.Buffers" Version="4.5.0" />
<PackageReference Update="System.IO.Compression" Version="4.3.0" />
<PackageReference Update="System.IO.UnmanagedMemoryStream" Version="4.3.0" />
<PackageReference Update="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" />
<PackageReference Update="System.Memory" Version="4.5.3" />
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Version="4.7" />
<PackageReference Update="System.Threading.Tasks.Parallel" Version="4.3.0" />
<PackageReference Update="System.ValueTuple" Version="4.5.0" />

7
src/ImageSharp/Formats/Png/Zlib/DeflaterHuffman.cs

@ -74,9 +74,11 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
this.pinnedLiteralBuffer = (short*)this.literalBufferHandle.Pointer;
}
#pragma warning disable SA1201 // Elements should appear in the correct order
// See RFC 1951 3.2.6
// Literal codes
private static short[] StaticLCodes => new short[]
private static readonly short[] StaticLCodes = new short[]
{
12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252,
2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242,
@ -121,7 +123,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
};
// Distance codes and lengths.
private static short[] StaticDCodes => new short[]
private static readonly short[] StaticDCodes = new short[]
{
0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14,
30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23
@ -132,6 +134,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
};
#pragma warning restore SA1201 // Elements should appear in the correct order
/// <summary>
/// Gets the lengths of the bit length codes are sent in order of decreasing probability, to avoid transmitting the lengths for unused bit length codes.

Loading…
Cancel
Save