Skip to content

Commit

Permalink
Remove duplicate code in RandomStream (#24762)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder authored Oct 18, 2021
1 parent df8a8c3 commit 9f8730c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions common/Perf/Azure.Test.Perf/RandomStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ namespace Azure.Test.Perf
{
public static class RandomStream
{
private static readonly Lazy<byte[]> _randomBytes = new Lazy<byte[]>(() =>
{
var randomData = new byte[1024 * 1024];
ThreadsafeRandom.NextBytes(randomData);
return randomData;
});
private static readonly Lazy<byte[]> _randomBytes = new Lazy<byte[]>(() => RandomByteArray.Create(1024 * 1024));

public static Stream Create(long size) => new CircularStream(new MemoryStream(_randomBytes.Value, writable: false), size);
}
Expand Down

0 comments on commit 9f8730c

Please sign in to comment.