mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-18 12:06:36 +00:00
Update dependencies
* Updates netlink/netns * Updates x/sys, arkade and apimachinery Build passes, minor updates. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
12
vendor/github.com/klauspost/compress/zstd/bitreader.go
generated
vendored
12
vendor/github.com/klauspost/compress/zstd/bitreader.go
generated
vendored
@ -7,6 +7,7 @@ package zstd
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/bits"
|
||||
)
|
||||
@ -50,16 +51,16 @@ func (b *bitReader) getBits(n uint8) int {
|
||||
if n == 0 /*|| b.bitsRead >= 64 */ {
|
||||
return 0
|
||||
}
|
||||
return b.getBitsFast(n)
|
||||
return int(b.get32BitsFast(n))
|
||||
}
|
||||
|
||||
// getBitsFast requires that at least one bit is requested every time.
|
||||
// get32BitsFast requires that at least one bit is requested every time.
|
||||
// There are no checks if the buffer is filled.
|
||||
func (b *bitReader) getBitsFast(n uint8) int {
|
||||
func (b *bitReader) get32BitsFast(n uint8) uint32 {
|
||||
const regMask = 64 - 1
|
||||
v := uint32((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask))
|
||||
b.bitsRead += n
|
||||
return int(v)
|
||||
return v
|
||||
}
|
||||
|
||||
// fillFast() will make sure at least 32 bits are available.
|
||||
@ -125,6 +126,9 @@ func (b *bitReader) remain() uint {
|
||||
func (b *bitReader) close() error {
|
||||
// Release reference.
|
||||
b.in = nil
|
||||
if !b.finished() {
|
||||
return fmt.Errorf("%d extra bits on block, should be 0", b.remain())
|
||||
}
|
||||
if b.bitsRead > 64 {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
|
Reference in New Issue
Block a user