Skip to content

Commit d04e28b

Browse files
Use span to fill array
1 parent faa6ce3 commit d04e28b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Src/Tests/Bitcoin/Cryptography/Hashing/HashTestCaseHelper.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ public static IEnumerable<object[]> GetCommonHashCases(string name)
3838

3939
public static byte[] GetAMillionA()
4040
{
41-
byte[] message = new byte[1_000_000];
42-
for (int i = 0; i < message.Length; i++)
43-
{
44-
message[i] = (byte)'a';
45-
}
46-
return message;
41+
Span<byte> message = new byte[1_000_000];
42+
message.Fill((byte)'a');
43+
return message.ToArray();
4744
}
4845

4946

0 commit comments

Comments
 (0)