diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-01-30 15:38:19 +0100 |
commit | 4cecda6c347bd6902b960c6a35a967add7070b0d (patch) | |
tree | a462e224ff41ec9f3eb1a0b6e815806f9e8804ad /src/pkg/compress/flate/huffman_code.go | |
parent | 6c7ca6e4d4e26e4c8cbe0d183966011b3b088a0a (diff) | |
download | golang-4cecda6c347bd6902b960c6a35a967add7070b0d.tar.gz |
Imported Upstream version 2012.01.27upstream-weekly/2012.01.27
Diffstat (limited to 'src/pkg/compress/flate/huffman_code.go')
-rw-r--r-- | src/pkg/compress/flate/huffman_code.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/compress/flate/huffman_code.go b/src/pkg/compress/flate/huffman_code.go index 7ed603a4f..4873b0fce 100644 --- a/src/pkg/compress/flate/huffman_code.go +++ b/src/pkg/compress/flate/huffman_code.go @@ -195,7 +195,9 @@ func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 { // The tree can't have greater depth than n - 1, no matter what. This // saves a little bit of work in some small cases - maxBits = minInt32(maxBits, n-1) + if maxBits > n-1 { + maxBits = n - 1 + } // Create information about each of the levels. // A bogus "Level 0" whose sole purpose is so that |