From 98620c56d6ad0d896308a4e5858c5d1913476eaf Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 10 Sep 2020 09:31:28 -0400 Subject: vendor containers/storage v1.23.5 Signed-off-by: Daniel J Walsh --- vendor/github.com/klauspost/compress/huff0/huff0.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vendor/github.com/klauspost/compress/huff0') 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 -- cgit v1.2.3-54-g00ecf