summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/zstd
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2021-08-17 12:21:23 +0000
committerGitHub <noreply@github.com>2021-08-17 12:21:23 +0000
commite9f4d81790d2016f320bbb4500c3474613974491 (patch)
tree1a0a8bfaf7cad9d8afc9b30d03c52fd11fa434b9 /vendor/github.com/klauspost/compress/zstd
parent8c228bdbd031e5930e6319e8fe25b3ff340919f3 (diff)
downloadpodman-e9f4d81790d2016f320bbb4500c3474613974491.tar.gz
podman-e9f4d81790d2016f320bbb4500c3474613974491.tar.bz2
podman-e9f4d81790d2016f320bbb4500c3474613974491.zip
Bump github.com/containers/storage from 1.34.0 to 1.34.1
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.34.0 to 1.34.1. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.34.0...v1.34.1) --- updated-dependencies: - dependency-name: github.com/containers/storage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/zstd')
-rw-r--r--vendor/github.com/klauspost/compress/zstd/enc_best.go30
1 files changed, 21 insertions, 9 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/enc_best.go b/vendor/github.com/klauspost/compress/zstd/enc_best.go
index 41025d62b..96028ecd8 100644
--- a/vendor/github.com/klauspost/compress/zstd/enc_best.go
+++ b/vendor/github.com/klauspost/compress/zstd/enc_best.go
@@ -5,6 +5,7 @@
package zstd
import (
+ "bytes"
"fmt"
"github.com/klauspost/compress"
@@ -208,6 +209,11 @@ encodeLoop:
if s-offset >= e.maxMatchOff || load3232(src, offset) != first {
return match{s: s, est: highScore}
}
+ if debugAsserts {
+ if !bytes.Equal(src[s:s+4], src[offset:offset+4]) {
+ panic(fmt.Sprintf("first match mismatch: %v != %v, first: %08x", src[s:s+4], src[offset:offset+4], first))
+ }
+ }
m := match{offset: offset, s: s, length: 4 + e.matchlen(s+4, offset+4, src), rep: rep}
m.estBits(bitsPerByte)
return m
@@ -218,17 +224,17 @@ encodeLoop:
best = bestOf(best, matchAt(candidateS.prev-e.cur, s, uint32(cv), -1))
if canRepeat && best.length < goodEnough {
- cv := uint32(cv >> 8)
+ cv32 := uint32(cv >> 8)
spp := s + 1
- best = bestOf(best, matchAt(spp-offset1, spp, cv, 1))
- best = bestOf(best, matchAt(spp-offset2, spp, cv, 2))
- best = bestOf(best, matchAt(spp-offset3, spp, cv, 3))
+ best = bestOf(best, matchAt(spp-offset1, spp, cv32, 1))
+ best = bestOf(best, matchAt(spp-offset2, spp, cv32, 2))
+ best = bestOf(best, matchAt(spp-offset3, spp, cv32, 3))
if best.length > 0 {
- cv >>= 16
+ cv32 = uint32(cv >> 24)
spp += 2
- best = bestOf(best, matchAt(spp-offset1, spp, cv, 1))
- best = bestOf(best, matchAt(spp-offset2, spp, cv, 2))
- best = bestOf(best, matchAt(spp-offset3, spp, cv, 3))
+ best = bestOf(best, matchAt(spp-offset1, spp, cv32, 1))
+ best = bestOf(best, matchAt(spp-offset2, spp, cv32, 2))
+ best = bestOf(best, matchAt(spp-offset3, spp, cv32, 3))
}
}
// Load next and check...
@@ -281,6 +287,12 @@ encodeLoop:
}
}
+ if debugAsserts {
+ if !bytes.Equal(src[best.s:best.s+best.length], src[best.offset:best.offset+best.length]) {
+ panic(fmt.Sprintf("match mismatch: %v != %v", src[best.s:best.s+best.length], src[best.offset:best.offset+best.length]))
+ }
+ }
+
// We have a match, we can store the forward value
if best.rep > 0 {
s = best.s
@@ -356,7 +368,7 @@ encodeLoop:
panic(fmt.Sprintf("s (%d) <= t (%d)", s, t))
}
- if debugAsserts && canRepeat && int(offset1) > len(src) {
+ if debugAsserts && int(offset1) > len(src) {
panic("invalid offset")
}