summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/flate
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-09-29 15:24:31 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-09-29 15:25:54 -0400
commit1805ed360d41e5b4ed90e9493e59a2129608dcd5 (patch)
treed77b405b70c866af963de54d8f71b8a95fa54ae5 /vendor/github.com/klauspost/compress/flate
parentd987f26f1e2449d3237faa0b873d82ce5a89e0ee (diff)
downloadpodman-1805ed360d41e5b4ed90e9493e59a2129608dcd5.tar.gz
podman-1805ed360d41e5b4ed90e9493e59a2129608dcd5.tar.bz2
podman-1805ed360d41e5b4ed90e9493e59a2129608dcd5.zip
Vendor in latest containers/storage
Fix handling of additional shares with no images Fixes: https://github.com/containers/storage/issues/1029 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/flate')
-rw-r--r--vendor/github.com/klauspost/compress/flate/fast_encoder.go25
1 files changed, 8 insertions, 17 deletions
diff --git a/vendor/github.com/klauspost/compress/flate/fast_encoder.go b/vendor/github.com/klauspost/compress/flate/fast_encoder.go
index 347ac2c90..a746eb733 100644
--- a/vendor/github.com/klauspost/compress/flate/fast_encoder.go
+++ b/vendor/github.com/klauspost/compress/flate/fast_encoder.go
@@ -215,24 +215,15 @@ func (e *fastGen) Reset() {
func matchLen(a, b []byte) int {
b = b[:len(a)]
var checked int
- if len(a) >= 4 {
- // Try 4 bytes first
- if diff := binary.LittleEndian.Uint32(a) ^ binary.LittleEndian.Uint32(b); diff != 0 {
- return bits.TrailingZeros32(diff) >> 3
- }
- // Switch to 8 byte matching.
- checked = 4
- a = a[4:]
- b = b[4:]
- for len(a) >= 8 {
- b = b[:len(a)]
- if diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b); diff != 0 {
- return checked + (bits.TrailingZeros64(diff) >> 3)
- }
- checked += 8
- a = a[8:]
- b = b[8:]
+
+ for len(a) >= 8 {
+ b = b[:len(a)]
+ if diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b); diff != 0 {
+ return checked + (bits.TrailingZeros64(diff) >> 3)
}
+ checked += 8
+ a = a[8:]
+ b = b[8:]
}
b = b[:len(a)]
for i := range a {