Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nikos Baxevanis <nikos.baxevanis@gmail.com>
  • Loading branch information
MagnusMikkelsen and moodmosaic authored Jun 30, 2020
1 parent c5df829 commit e79ae4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Src/Fare.Benchmarking/Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ namespace Fare.Benchmarking
{
public class Benchmark
{
private const string Pattern = ".";
private readonly Random random = new Random();

[Benchmark]
public Xeger XegerCtorSimple() => new Xeger(".");

[Benchmark]
public Xeger XegerCtorInjectRandom() => new Xeger(Pattern, this.random);
public Xeger XegerCtorInjectRandom() => new Xeger(".", this.random);
}
}
4 changes: 2 additions & 2 deletions Src/Fare.Benchmarking/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Program
{
public static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<Benchmark>();
BenchmarkRunner.Run<Benchmark>();
}
}
}
}
6 changes: 3 additions & 3 deletions Src/Fare/Xeger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public Xeger(string regex, Random random)

/// <summary>
/// Initializes a new instance of the <see cref="Xeger"/> class.<br/>
/// Note that if multiple instances are created within short time, using this overload,<br/>
/// Note that if multiple instances are created within short time using this overload,<br/>
/// the instances might generate identical random strings.<br/>
/// To avoid this - use the constructor overload that accepts an argument of type Random
/// To avoid this, use the constructor overload that accepts an argument of type Random.
/// </summary>
/// <param name="regex">The regex.</param>
public Xeger(string regex)
Expand Down Expand Up @@ -141,4 +141,4 @@ private string RemoveStartEndMarkers(string regExp)
return regExp;
}
}
}
}

0 comments on commit e79ae4d

Please sign in to comment.