Merge pull request #6678 from Bond-009/random

Use new Random.Shared instead of creating new instances
This commit is contained in:
Claus Vium
2021-10-08 16:04:23 +02:00
committed by GitHub
4 changed files with 4 additions and 7 deletions

View File

@@ -5,13 +5,11 @@ namespace Jellyfin.Extensions.Tests
{
public static class ShuffleExtensionsTests
{
private static readonly Random _rng = new Random();
[Fact]
public static void Shuffle_Valid_Correct()
{
byte[] original = new byte[1 << 6];
_rng.NextBytes(original);
Random.Shared.NextBytes(original);
byte[] shuffled = (byte[])original.Clone();
shuffled.Shuffle();