forked from forgejo/forgejo
go1.16 (#14783)
This commit is contained in:
parent
030646eea4
commit
47f6a4ec3f
947 changed files with 26119 additions and 7062 deletions
27
vendor/github.com/ulikunitz/xz/lzma/operation.go
generated
vendored
27
vendor/github.com/ulikunitz/xz/lzma/operation.go
generated
vendored
|
@ -1,11 +1,10 @@
|
|||
// 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 (
|
||||
"errors"
|
||||
"fmt"
|
||||
"unicode"
|
||||
)
|
||||
|
@ -24,30 +23,6 @@ type match struct {
|
|||
n int
|
||||
}
|
||||
|
||||
// verify checks whether the match is valid. If that is not the case an
|
||||
// error is returned.
|
||||
func (m match) verify() error {
|
||||
if !(minDistance <= m.distance && m.distance <= maxDistance) {
|
||||
return errors.New("distance out of range")
|
||||
}
|
||||
if !(1 <= m.n && m.n <= maxMatchLen) {
|
||||
return errors.New("length out of range")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// l return the l-value for the match, which is the difference of length
|
||||
// n and 2.
|
||||
func (m match) l() uint32 {
|
||||
return uint32(m.n - minMatchLen)
|
||||
}
|
||||
|
||||
// dist returns the dist value for the match, which is one less of the
|
||||
// distance stored in the match.
|
||||
func (m match) dist() uint32 {
|
||||
return uint32(m.distance - minDistance)
|
||||
}
|
||||
|
||||
// Len returns the number of bytes matched.
|
||||
func (m match) Len() int {
|
||||
return m.n
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue