To be more specific about what it is.
<Compile Include="$(MSBuildThisFileDirectory)System\Progress.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Random.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Random.ImplBase.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Random.LegacyImpl.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Random.Net5CompatImpl.cs" />
<Compile Condition="'$(Is64Bit)' != 'true'" Include="$(MSBuildThisFileDirectory)System\Random.Xoshiro128StarStarImpl.cs" />
<Compile Condition="'$(Is64Bit)' == 'true'" Include="$(MSBuildThisFileDirectory)System\Random.Xoshiro256StarStarImpl.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Range.cs" />
/// of Knuth's subtractive random number generator algorithm. See https://github.com/dotnet/runtime/issues/23198
/// for a discussion of some of the modifications / discrepancies.
/// </summary>
- private sealed class LegacyImpl : ImplBase
+ private sealed class Net5CompatImpl : ImplBase
{
/// <summary>Thread-static instance used to seed any legacy implementations created with the default ctor.</summary>
[ThreadStatic]
private int _inext;
private int _inextp;
- public LegacyImpl(Random parent) : this(parent, (t_seedGenerator ??= new()).Next())
+ public Net5CompatImpl(Random parent) : this(parent, (t_seedGenerator ??= new()).Next())
{
}
- public LegacyImpl(Random parent, int Seed)
+ public Net5CompatImpl(Random parent, int Seed)
{
_parent = parent;
// With no seed specified, if this is the base type, we can implement this however we like.
// If it's a derived type, for compat we respect the previous implementation, so that overrides
// are called as they were previously.
- _impl = GetType() == typeof(Random) ? new XoshiroImpl() : new LegacyImpl(this);
+ _impl = GetType() == typeof(Random) ? new XoshiroImpl() : new Net5CompatImpl(this);
/// <summary>Initializes a new instance of the Random class, using the specified seed value.</summary>
/// <param name="Seed">
public Random(int Seed) =>
// With a custom seed, for compat we respect the previous implementation so that the same sequence
// previously output continues to be output.
- _impl = new LegacyImpl(this, Seed);
+ _impl = new Net5CompatImpl(this, Seed);
/// <summary>Returns a non-negative random integer.</summary>
/// <returns>A 32-bit signed integer that is greater than or equal to 0 and less than <see cref="int.MaxValue"/>.</returns>