diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2019-06-24 21:29:31 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2019-06-24 21:29:31 +0200 |
commit | 2388222e98462fdbbe44f3e091b2b79d80956a9a (patch) | |
tree | 17078d861c20a3e48b19c750c6864c5f59248386 /vendor/github.com/klauspost/compress/flate/huffman_code.go | |
parent | a1a4a75abee2c381483a218e1660621ee416ef7c (diff) | |
download | podman-2388222e98462fdbbe44f3e091b2b79d80956a9a.tar.gz podman-2388222e98462fdbbe44f3e091b2b79d80956a9a.tar.bz2 podman-2388222e98462fdbbe44f3e091b2b79d80956a9a.zip |
update dependencies
Ran a `go get -u` and bumped K8s deps to 1.15.0.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/flate/huffman_code.go')
-rw-r--r-- | vendor/github.com/klauspost/compress/flate/huffman_code.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/klauspost/compress/flate/huffman_code.go b/vendor/github.com/klauspost/compress/flate/huffman_code.go index bdcbd823b..f65f79336 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_code.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_code.go @@ -6,6 +6,7 @@ package flate import ( "math" + "math/bits" "sort" ) @@ -56,7 +57,9 @@ func (h *hcode) set(code uint16, length uint16) { func maxNode() literalNode { return literalNode{math.MaxUint16, math.MaxInt32} } func newHuffmanEncoder(size int) *huffmanEncoder { - return &huffmanEncoder{codes: make([]hcode, size)} + // Make capacity to next power of two. + c := uint(bits.Len32(uint32(size - 1))) + return &huffmanEncoder{codes: make([]hcode, size, 1<<c)} } // Generates a HuffmanCode corresponding to the fixed literal table |