diff --git a/X10D/src/Collections/BinaryIntegerExtensions.cs b/X10D/src/Collections/BinaryIntegerExtensions.cs index 7c68d88..0aec0d0 100644 --- a/X10D/src/Collections/BinaryIntegerExtensions.cs +++ b/X10D/src/Collections/BinaryIntegerExtensions.cs @@ -1,4 +1,5 @@ #if NET7_0_OR_GREATER +using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Numerics; using System.Runtime.CompilerServices; @@ -48,6 +49,28 @@ public static class BinaryIntegerExtensions } } + UnpackInternal(value, destination); + } + + [MethodImpl(CompilerResources.MaxOptimization)] + private static void UnpackInternal_Fallback(this TInteger value, Span destination) + where TInteger : unmanaged, IBinaryInteger + { + unsafe + { + int bitCount = sizeof(TInteger) * 8; + for (var index = 0; index < bitCount; index++) + { + destination[index] = (value & (TInteger.One << index)) != TInteger.Zero; + } + } + } + + [ExcludeFromCodeCoverage] + [MethodImpl(CompilerResources.MaxOptimization)] + private static void UnpackInternal(TInteger value, Span destination) + where TInteger : unmanaged, IBinaryInteger + { switch (value) { case byte valueByte when Sse3.IsSupported: @@ -71,19 +94,5 @@ public static class BinaryIntegerExtensions break; } } - - [MethodImpl(CompilerResources.MaxOptimization)] - internal static void UnpackInternal_Fallback(this TInteger value, Span destination) - where TInteger : unmanaged, IBinaryInteger - { - unsafe - { - int bitCount = sizeof(TInteger) * 8; - for (var index = 0; index < bitCount; index++) - { - destination[index] = (value & (TInteger.One << index)) != TInteger.Zero; - } - } - } } #endif