summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/huff0/bitwriter.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-08-24 17:39:46 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-08-27 15:03:01 -0400
commit1a30bcde30bfdffd90d01455e56940703bf407a5 (patch)
treedc69f5929bc97602116fa8ea1e5d5d94aa4c6028 /vendor/github.com/klauspost/compress/huff0/bitwriter.go
parent72c5b35ea5db44ca1c81a688d90f5c3aa8f8262e (diff)
downloadpodman-1a30bcde30bfdffd90d01455e56940703bf407a5.tar.gz
podman-1a30bcde30bfdffd90d01455e56940703bf407a5.tar.bz2
podman-1a30bcde30bfdffd90d01455e56940703bf407a5.zip
Update c/storage to v1.23.2
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'vendor/github.com/klauspost/compress/huff0/bitwriter.go')
-rw-r--r--vendor/github.com/klauspost/compress/huff0/bitwriter.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/vendor/github.com/klauspost/compress/huff0/bitwriter.go
index bda4021ef..6bce4e87d 100644
--- a/vendor/github.com/klauspost/compress/huff0/bitwriter.go
+++ b/vendor/github.com/klauspost/compress/huff0/bitwriter.go
@@ -43,6 +43,11 @@ func (b *bitWriter) addBits16Clean(value uint16, bits uint8) {
func (b *bitWriter) encSymbol(ct cTable, symbol byte) {
enc := ct[symbol]
b.bitContainer |= uint64(enc.val) << (b.nBits & 63)
+ if false {
+ if enc.nBits == 0 {
+ panic("nbits 0")
+ }
+ }
b.nBits += enc.nBits
}
@@ -54,6 +59,14 @@ func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) {
sh := b.nBits & 63
combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63))
b.bitContainer |= combined << sh
+ if false {
+ if encA.nBits == 0 {
+ panic("nbitsA 0")
+ }
+ if encB.nBits == 0 {
+ panic("nbitsB 0")
+ }
+ }
b.nBits += encA.nBits + encB.nBits
}