From 1c0c06f89ce388c4f5d4af1f86c32eecbaf14094 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Tue, 29 Nov 2022 16:21:02 +0000 Subject: [PATCH] Only create Shared random for .NET < 6 --- X10D/src/Core/RandomExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/X10D/src/Core/RandomExtensions.cs b/X10D/src/Core/RandomExtensions.cs index a111704..5fcb109 100644 --- a/X10D/src/Core/RandomExtensions.cs +++ b/X10D/src/Core/RandomExtensions.cs @@ -1,4 +1,4 @@ -using System.Globalization; +using System.Globalization; using System.Text; using X10D.Math; @@ -9,7 +9,9 @@ namespace X10D.Core; /// public static class RandomExtensions { +#if !NET6_0_OR_GREATER private static readonly Random Shared = new(); +#endif /// /// Returns a random value that defined in a specified enum.