use Random.Shared

This commit is contained in:
UbitUmarov
2022-10-16 15:06:36 +01:00
parent 0f3d7f45d9
commit 8895577c80
20 changed files with 63 additions and 85 deletions

View File

@@ -913,10 +913,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float llFrand(double mag)
{
lock (Util.RandomClass)
{
return Util.RandomClass.NextDouble() * mag;
}
return Random.Shared.NextDouble() * mag;
}
public LSL_Integer llFloor(double f)
@@ -5985,12 +5982,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_List llListRandomize(LSL_List src, int stride)
{
LSL_List result;
Random rand = new Random();
int chunkk;
int[] chunks;
if (stride <= 0)
{
stride = 1;
@@ -6015,7 +6010,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
for (int i = chunkk - 1; i > 0; i--)
{
// Elect an unrandomized chunk to swap
int index = rand.Next(i + 1);
int index = Random.Shared.Next(i + 1);
// and swap position with first unrandomized chunk
int tmp = chunks[i];