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/zstd/dict.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/zstd/dict.go')
-rw-r--r-- | vendor/github.com/klauspost/compress/zstd/dict.go | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go index 8eb6f6ba3..fa25a18d8 100644 --- a/vendor/github.com/klauspost/compress/zstd/dict.go +++ b/vendor/github.com/klauspost/compress/zstd/dict.go @@ -13,14 +13,31 @@ import ( type dict struct { id uint32 - litDec *huff0.Scratch + litEnc *huff0.Scratch llDec, ofDec, mlDec sequenceDec - offsets [3]int - content []byte + //llEnc, ofEnc, mlEnc []*fseEncoder + offsets [3]int + content []byte } var dictMagic = [4]byte{0x37, 0xa4, 0x30, 0xec} +// ID returns the dictionary id or 0 if d is nil. +func (d *dict) ID() uint32 { + if d == nil { + return 0 + } + return d.id +} + +// DictContentSize returns the dictionary content size or 0 if d is nil. +func (d *dict) DictContentSize() int { + if d == nil { + return 0 + } + return len(d.content) +} + // Load a dictionary as described in // https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format func loadDict(b []byte) (*dict, error) { @@ -43,10 +60,11 @@ func loadDict(b []byte) (*dict, error) { // Read literal table var err error - d.litDec, b, err = huff0.ReadTable(b[8:], nil) + d.litEnc, b, err = huff0.ReadTable(b[8:], nil) if err != nil { return nil, err } + d.litEnc.Reuse = huff0.ReusePolicyMust br := byteReader{ b: b, |