DeeterministicRandom types optimized.
This commit is contained in:
1 parent
1b3882addc
commit
e8cca74f68
3 files changed
+9
-20
No files matched your search
@@ -13,11 +13,6 @@ internal static class DeterministicRandomCpu
|
||||
public static ulong NextUInt64()
|
||||
{
|
||||
ulong state = s_threadState;
|
||||
if (state == 0UL)
|
||||
{
|
||||
state = InitializeThreadState();
|
||||
}
|
||||
|
||||
state ^= state >> 12;
|
||||
state ^= state << 25;
|
||||
state ^= state >> 27;
|
||||
@@ -34,7 +29,7 @@ internal static class DeterministicRandomCpu
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
private static ulong InitializeThreadState()
|
||||
public static ulong Initialize()
|
||||
{
|
||||
ulong seed = (ulong)Interlocked.Increment(ref s_seedCounter);
|
||||
seed += 0x9E3779B97F4A7C15UL;
|
||||
|
||||
Reference in new issue
Block a user