diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2021-04-12 09:45:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 09:45:08 +0000 |
commit | 3627c4b691a357fc531c2761f07ccfecf937dd12 (patch) | |
tree | efb7643f74beadd946dc052f537743454a076462 /vendor/github.com/klauspost/compress/zstd/encoder.go | |
parent | 669311d8d8a8881571ccc81ce48b9202b15b9def (diff) | |
download | podman-3627c4b691a357fc531c2761f07ccfecf937dd12.tar.gz podman-3627c4b691a357fc531c2761f07ccfecf937dd12.tar.bz2 podman-3627c4b691a357fc531c2761f07ccfecf937dd12.zip |
Bump github.com/containers/image/v5 from 5.10.5 to 5.11.0
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.10.5 to 5.11.0.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](https://github.com/containers/image/compare/v5.10.5...v5.11.0)
Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/zstd/encoder.go')
-rw-r--r-- | vendor/github.com/klauspost/compress/zstd/encoder.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index f5759211d..6f0265099 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -106,7 +106,7 @@ func (e *Encoder) Reset(w io.Writer) { s.encoder = e.o.encoder() } if s.writing == nil { - s.writing = &blockEnc{} + s.writing = &blockEnc{lowMem: e.o.lowMem} s.writing.init() } s.writing.initNewEncode() @@ -176,6 +176,12 @@ func (e *Encoder) nextBlock(final bool) error { } if !s.headerWritten { // If we have a single block encode, do a sync compression. + if final && len(s.filling) == 0 && !e.o.fullZero { + s.headerWritten = true + s.fullFrameWritten = true + s.eofWritten = true + return nil + } if final && len(s.filling) > 0 { s.current = e.EncodeAll(s.filling, s.current[:0]) var n2 int @@ -471,7 +477,7 @@ func (e *Encoder) EncodeAll(src, dst []byte) []byte { } // If less than 1MB, allocate a buffer up front. - if len(dst) == 0 && cap(dst) == 0 && len(src) < 1<<20 { + if len(dst) == 0 && cap(dst) == 0 && len(src) < 1<<20 && !e.o.lowMem { dst = make([]byte, 0, len(src)) } dst, err := fh.appendTo(dst) |