Skip to content

Commit da44917

Browse files
committed
Review changes - stephentoub dotnet#1
1 parent 3b42db2 commit da44917

File tree

1 file changed

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

1 file changed

+6
-3
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace System.Net.Http.HPack
1010
internal static class Huffman
1111
{
1212
// HPack static huffman code. see: https://httpwg.org/specs/rfc7541.html#huffman.code
13-
// Stored into two table to optimize its initialization and memory consumption.
13+
// Stored into two tables to optimize its initialization and memory consumption.
1414
private static readonly uint[] s_encodingTableCodes = new uint[257]
1515
{
1616
0b11111111_11000000_00000000_00000000,
@@ -574,12 +574,15 @@ private static ushort[] GenerateDecodingLookupTree()
574574
// it is guaranteed that for this huffman code generated decoding lookup tree MUST consist of exactly 15 lookup tables
575575
var decodingTree = new ushort[15 * 256];
576576

577+
uint[] encodingTableCodes = s_encodingTableCodes;
578+
ReadOnlySpan<byte> encodingTableBitLengths = EncodingTableBitLengths;
579+
577580
int allocatedLookupTableIndex = 0;
578581
// Create traverse path for all 0..256 octets, 256 is EOS, see: http://httpwg.org/specs/rfc7541.html#rfc.section.5.2
579582
for (int octet = 0; octet <= 256; octet++)
580583
{
581-
uint code = s_encodingTableCodes[octet];
582-
int bitLength = EncodingTableBitLengths[octet];
584+
uint code = encodingTableCodes[octet];
585+
int bitLength = encodingTableBitLengths[octet];
583586

584587
int lookupTableIndex = 0;
585588
int bitsLeft = bitLength;

0 commit comments

Comments
 (0)