Skip to content

Commit c8447de

Browse files
authored
Merge pull request #385 from CallumDev/patch-1
CRC32C: Remove unnecessary fields
2 parents 8958e67 + ee9c633 commit c8447de

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

LiteNetLib/Utils/CRC32C.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@ namespace LiteNetLib.Utils
88
//Implementation from Crc32.NET
99
public static class CRC32C
1010
{
11-
#if NETCOREAPP3_0
12-
private static readonly bool _x64Available;
13-
private static readonly bool _sseAvailable;
14-
#endif
1511
public const int ChecksumSize = 4;
1612
private const uint Poly = 0x82F63B78u;
1713
private static readonly uint[] Table;
1814

1915
static CRC32C()
2016
{
2117
#if NETCOREAPP3_0
22-
_sseAvailable = Sse42.IsSupported;
23-
_x64Available = Sse42.X64.IsSupported;
24-
if(_sseAvailable)
18+
if(Sse42.IsSupported)
2519
return;
2620
#endif
2721
Table = new uint[16 * 256];
@@ -48,9 +42,9 @@ public static uint Compute(byte[] input, int offset, int length)
4842
{
4943
uint crcLocal = uint.MaxValue;
5044
#if NETCOREAPP3_0
51-
if(_sseAvailable)
45+
if(Sse42.IsSupported)
5246
{
53-
if (_x64Available)
47+
if (Sse42.X64.IsSupported)
5448
{
5549
while (length >= 8)
5650
{

0 commit comments

Comments
 (0)