mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-23 07:25:11 +00:00
Eliminate three allocations in HbMakeCodeLengths
This commit is contained in:
@@ -89,9 +89,9 @@ namespace SharpCompress.Compressors.BZip2
|
||||
int nNodes, nHeap, n1, n2, i, j, k;
|
||||
bool tooLong;
|
||||
|
||||
int[] heap = new int[BZip2Constants.MAX_ALPHA_SIZE + 2];
|
||||
int[] weight = new int[BZip2Constants.MAX_ALPHA_SIZE * 2];
|
||||
int[] parent = new int[BZip2Constants.MAX_ALPHA_SIZE * 2];
|
||||
Span<int> heap = stackalloc int[BZip2Constants.MAX_ALPHA_SIZE + 2]; // 1040 bytes
|
||||
Span<int> weight = stackalloc int[BZip2Constants.MAX_ALPHA_SIZE * 2]; // 1040 bytes
|
||||
Span<int> parent = stackalloc int[BZip2Constants.MAX_ALPHA_SIZE * 2]; // 1040 bytes
|
||||
|
||||
for (i = 0; i < alphaSize; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user