Skip to content

Commit

Permalink
Code cleaning.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Feb 13, 2023
1 parent c4ef8d6 commit 3eb200c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ListShuffle.Tests.Net50/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void TestConcurrency()
{
int totalFives = 0;

var result = Parallel.For(1, 100001, (i, state) =>
var result = Parallel.For(1, 100001, (_, _) =>
{
var list = new List<int>();
for (int j = 1; j <= 10; j++)
Expand Down Expand Up @@ -75,7 +75,7 @@ public void TestConcurrencyCryptoStrong()
{
int totalFives = 0;

var result = Parallel.For(1, 100001, (i, state) =>
var result = Parallel.For(1, 100001, (_, _) =>
{
var list = new List<int>();
for (int j = 1; j <= 10; j++)
Expand Down
4 changes: 2 additions & 2 deletions ListShuffle.Tests.Net60/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void TestConcurrency()
{
int totalFives = 0;

var result = Parallel.For(1, 100001, (i, state) =>
var result = Parallel.For(1, 100001, (_, _) =>
{
var list = new List<int>();
for (int j = 1; j <= 10; j++)
Expand Down Expand Up @@ -75,7 +75,7 @@ public void TestConcurrencyCryptoStrong()
{
int totalFives = 0;

var result = Parallel.For(1, 100001, (i, state) =>
var result = Parallel.For(1, 100001, (_, _) =>
{
var list = new List<int>();
for (int j = 1; j <= 10; j++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net48</TargetFramework>

<LangVersion>9.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion ListShuffle.Tests.NetFramework/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void TestConcurrencyCryptoStrongNetFramework()
{
int totalFives = 0;

var result = Parallel.For(1, 100001, (i, state) =>
var result = Parallel.For(1, 100001, (_, _) =>
{
var list = new List<int>();
for (int j = 1; j <= 10; j++)
Expand Down
7 changes: 5 additions & 2 deletions ListShuffle/ListExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ public static void Shuffle<T>(this IList<T> list)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void CryptoStrongShuffle<T>(this IList<T> list)
{
if (list == null) throw new ArgumentNullException(nameof(list));
if (list == null)
{
throw new ArgumentNullException(nameof(list));
}
int n = list.Count;
#if NETSTANDARD2_0
using (var generator = RandomNumberGenerator.Create())
using var generator = RandomNumberGenerator.Create();
#endif
while (n > 1)
{
Expand Down
9 changes: 5 additions & 4 deletions ListShuffle/ListShuffle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Authors>Mark Cilia Vincenti</Authors>
<LangVersion>8.0</LangVersion>
<RepositoryUrl>https://github.com/MarkCiliaVincenti/ListShuffle.git</RepositoryUrl>
<PackageProjectUrl>https://github.com/MarkCiliaVincenti/ListShuffle</PackageProjectUrl>
<Copyright>MIT</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>1.1.4</Version>
<Version>1.1.5</Version>
<PackageIcon>logo.png</PackageIcon>
<PackageReleaseNotes>Enabled deterministic builds, allowing debugging of this library from your code.</PackageReleaseNotes>
<PackageReleaseNotes>Code cleaning.</PackageReleaseNotes>
<Description>Thread-safe list shuffle extension library, using Fisher-Yates shuffle and optional cryptographically-strong random.</Description>
<Copyright>© 2023 Mark Cilia Vincenti</Copyright>
<PackageTags>list,shuffle,shuffler,extension,threadsafe,thread-safe,random</PackageTags>
<RepositoryType>git</RepositoryType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<AssemblyVersion>1.1.4.0</AssemblyVersion>
<FileVersion>1.1.4.0</FileVersion>
<AssemblyVersion>1.1.5.0</AssemblyVersion>
<FileVersion>1.1.5.0</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsPackable>true</IsPackable>
<IsTrimmable>true</IsTrimmable>
Expand Down

0 comments on commit 3eb200c

Please sign in to comment.