Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
删除无用空行,使用var简单类型.
  • Loading branch information
joesdu authored Sep 19, 2024
1 parent 4085d70 commit 8105b00
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/EasilyNET.Core/Misc/RandomExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ public static int StrictNext(this Random rand, int startIndex = 0, int maxValue
{
throw new ArgumentOutOfRangeException(nameof(startIndex), "startIndex must be less than maxValue.");
}

Span<byte> buffer = stackalloc byte[4];
RandomNumberGenerator.Fill(buffer);

int randomValue = BitConverter.ToInt32(buffer);
var randomValue = BitConverter.ToInt32(buffer);
return new Random(randomValue).Next(startIndex, maxValue);
}

Expand All @@ -51,4 +49,4 @@ public static double NextGauss(this Random rand, double mean, double stdDev)
var randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) * Math.Sin(2.0 * Math.PI * u2);
return mean + stdDev * randStdNormal;
}
}
}

0 comments on commit 8105b00

Please sign in to comment.