diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-09-10 09:31:28 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-09-10 09:34:31 -0400 |
commit | 98620c56d6ad0d896308a4e5858c5d1913476eaf (patch) | |
tree | df24f9bb53b8b455cf79cb57594987c7c0054b16 /vendor/github.com/klauspost/compress/huff0/huff0.go | |
parent | 08b602043ec07601b9be23c449c7773067683d90 (diff) | |
download | podman-98620c56d6ad0d896308a4e5858c5d1913476eaf.tar.gz podman-98620c56d6ad0d896308a4e5858c5d1913476eaf.tar.bz2 podman-98620c56d6ad0d896308a4e5858c5d1913476eaf.zip |
vendor containers/storage v1.23.5
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/huff0/huff0.go')
-rw-r--r-- | vendor/github.com/klauspost/compress/huff0/huff0.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go index 5dd66854b..7ec2022b6 100644 --- a/vendor/github.com/klauspost/compress/huff0/huff0.go +++ b/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -119,6 +119,16 @@ type Scratch struct { huffWeight [maxSymbolValue + 1]byte } +// TransferCTable will transfer the previously used compression table. +func (s *Scratch) TransferCTable(src *Scratch) { + if cap(s.prevTable) < len(src.prevTable) { + s.prevTable = make(cTable, 0, maxSymbolValue+1) + } + s.prevTable = s.prevTable[:len(src.prevTable)] + copy(s.prevTable, src.prevTable) + s.prevTableLog = src.prevTableLog +} + func (s *Scratch) prepare(in []byte) (*Scratch, error) { if len(in) > BlockSizeMax { return nil, ErrTooBig |