ppkarwasz commented on code in PR #699:
URL: https://github.com/apache/commons-compress/pull/699#discussion_r2303335373
##########
src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java:
##########
@@ -298,17 +300,16 @@ private boolean complete() throws IOException {
/**
* Called by recvDecodingTables() exclusively.
*/
- private void createHuffmanDecodingTables(final int alphaSize, final int
nGroups) throws IOException {
- final Data dataShadow = this.data;
+ static void createHuffmanDecodingTables(final int alphaSize, final int
nGroups, final Data dataShadow) throws IOException {
final char[][] len = dataShadow.temp_charArray2d;
final int[] minLens = dataShadow.minLens;
final int[][] limit = dataShadow.limit;
final int[][] base = dataShadow.base;
final int[][] perm = dataShadow.perm;
for (int t = 0; t < nGroups; t++) {
- int minLen = 32;
- int maxLen = 0;
+ int minLen = MAX_CODE_LEN;
Review Comment:
This suggestion doesn't make any difference: any value ≥ 20 would do fine.
However I see how this can hinder reasoning if we iterate over an empty set,
so I initialized the values to the length of the first symbol in
https://github.com/apache/commons-compress/pull/699/commits/7d1f6af54fd11a65f7a36f9602e843f7f8233d5c.
There are at least 2 symbols at this point in the execution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]