mirror of
https://github.com/CommunityToolkit/dotnet.git
synced 2026-10-28 19:17:46 +08:00
Fixed missing NET 5 path in BitOperations
This commit is contained in:
@@ -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--;
|
||||
|
||||
Reference in New Issue
Block a user