summaryrefslogtreecommitdiff
path: root/src/pkg/compress/flate/huffman_code.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/compress/flate/huffman_code.go')
-rw-r--r--src/pkg/compress/flate/huffman_code.go4
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