Skip to content

Commit

Permalink
Fix stackalloc loop in hpack test (#42416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher authored Sep 18, 2020
1 parent a820ca1 commit 8933510
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ public void HPack_IntegerDecode(int expectedResult, int bits, byte[] encoded)
public void IntegerEncoderDecoderRoundtrips()
{
IntegerDecoder decoder = new IntegerDecoder();
Span<byte> integerBytes = stackalloc byte[5];

for (int i = 0; i < 2048; ++i)
{
for (int prefixLength = 1; prefixLength <= 8; ++prefixLength)
{
Span<byte> integerBytes = stackalloc byte[5];
integerBytes.Clear();
Assert.True(IntegerEncoder.Encode(i, prefixLength, integerBytes, out int length));

bool decodeResult = decoder.BeginTryDecode(integerBytes[0], prefixLength, out int intResult);
Expand Down

0 comments on commit 8933510

Please sign in to comment.