From ce283ac5e6e9f1ace3c0a136f5fbbfdd615aa91e Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 15 Oct 2021 17:49:53 -0700 Subject: [PATCH] Remove duplicate code in RandomStream --- common/Perf/Azure.Test.Perf/RandomStream.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/common/Perf/Azure.Test.Perf/RandomStream.cs b/common/Perf/Azure.Test.Perf/RandomStream.cs index 6e77d0d3752fe..a61097e2e68b5 100644 --- a/common/Perf/Azure.Test.Perf/RandomStream.cs +++ b/common/Perf/Azure.Test.Perf/RandomStream.cs @@ -8,12 +8,7 @@ namespace Azure.Test.Perf { public static class RandomStream { - private static readonly Lazy _randomBytes = new Lazy(() => - { - var randomData = new byte[1024 * 1024]; - ThreadsafeRandom.NextBytes(randomData); - return randomData; - }); + private static readonly Lazy _randomBytes = new Lazy(() => RandomByteArray.Create(1024 * 1024)); public static Stream Create(long size) => new CircularStream(new MemoryStream(_randomBytes.Value, writable: false), size); }