mirror of
https://github.com/go-gitea/gitea
synced 2025-07-08 19:47:21 +00:00
go1.16 (#14783)
This commit is contained in:
13
vendor/github.com/ulikunitz/xz/lzma/directcodec.go
generated
vendored
13
vendor/github.com/ulikunitz/xz/lzma/directcodec.go
generated
vendored
@ -1,24 +1,13 @@
|
||||
// Copyright 2014-2019 Ulrich Kunitz. All rights reserved.
|
||||
// Copyright 2014-2021 Ulrich Kunitz. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package lzma
|
||||
|
||||
import "fmt"
|
||||
|
||||
// directCodec allows the encoding and decoding of values with a fixed number
|
||||
// of bits. The number of bits must be in the range [1,32].
|
||||
type directCodec byte
|
||||
|
||||
// makeDirectCodec creates a directCodec. The function panics if the number of
|
||||
// bits is not in the range [1,32].
|
||||
func makeDirectCodec(bits int) directCodec {
|
||||
if !(1 <= bits && bits <= 32) {
|
||||
panic(fmt.Errorf("bits=%d out of range", bits))
|
||||
}
|
||||
return directCodec(bits)
|
||||
}
|
||||
|
||||
// Bits returns the number of bits supported by this codec.
|
||||
func (dc directCodec) Bits() int {
|
||||
return int(dc)
|
||||
|
Reference in New Issue
Block a user