Skip to content

Commit 224f1bc

Browse files
committed
Review comments, gfoidl dotnet#1
- change local variables from ushort to int
1 parent 828c1d6 commit 224f1bc

File tree

1 file changed

+3
-4
lines changed
  • src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack

1 file changed

+3
-4
lines changed

src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/Huffman.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,9 @@ public static int Decode(ReadOnlySpan<byte> src, ref byte[] dstArray)
422422
int lookupTableIndex = 0;
423423
int lookupIndex;
424424

425-
ushort acc = 0;
425+
uint acc = 0;
426426
int bitsInAcc = 0;
427427

428-
429428
int i = 0;
430429
int j = 0;
431430
while (i < src.Length)
@@ -440,7 +439,7 @@ public static int Decode(ReadOnlySpan<byte> src, ref byte[] dstArray)
440439
{
441440
lookupIndex = (byte)(acc >> (bitsInAcc - 8));
442441

443-
ushort lookupValue = decodingTree[(lookupTableIndex << 8) + lookupIndex];
442+
int lookupValue = decodingTree[(lookupTableIndex << 8) + lookupIndex];
444443

445444
if (lookupValue < 0x80_00)
446445
{
@@ -499,7 +498,7 @@ public static int Decode(ReadOnlySpan<byte> src, ref byte[] dstArray)
499498
// Lookup index has to be 8 bits aligned to MSB
500499
lookupIndex = (byte)(acc << (8 - bitsInAcc));
501500

502-
ushort lookupValue = decodingTree[(lookupTableIndex << 8) + lookupIndex];
501+
int lookupValue = decodingTree[(lookupTableIndex << 8) + lookupIndex];
503502

504503
if (lookupValue < 0x80_00)
505504
{

0 commit comments

Comments
 (0)