Skip to content

Commit 5496540

Browse files
chore(internal): use Random.Shared in newer .NET versions
1 parent ee84747 commit 5496540

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Orb/OrbClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ namespace Orb;
1414
/// <inheritdoc/>
1515
public sealed class OrbClient : IOrbClient
1616
{
17+
#if NET
18+
static readonly Random Random = Random.Shared;
19+
#else
1720
static readonly ThreadLocal<Random> _threadLocalRandom = new(() => new Random());
1821

1922
static Random Random
2023
{
2124
get { return _threadLocalRandom.Value!; }
2225
}
26+
#endif
2327

2428
readonly ClientOptions _options;
2529

0 commit comments

Comments
 (0)