Fixed missing NET 5 path in BitOperations

This commit is contained in:
Sergio Pedri
2020-11-21 00:19:07 +01:00
parent 69834369a4
commit ef8976b3dc
@@ -4,7 +4,7 @@
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
using static System.Numerics.BitOperations;
#endif
@@ -25,7 +25,7 @@ namespace Microsoft.Toolkit.HighPerformance.Helpers.Internals
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int RoundUpPowerOfTwo(int x)
{
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
return 1 << (32 - LeadingZeroCount((uint)(x - 1)));
#else
x--;