mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.77 to 7.0.78 (#3431)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.77 to 7.0.78. - [Release notes](https://github.com/minio/minio-go/releases) - [Commits](https://github.com/minio/minio-go/compare/v7.0.77...v7.0.78) --- updated-dependencies: - dependency-name: github.com/minio/minio-go/v7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
25
vendor/github.com/klauspost/compress/s2/encode.go
generated
vendored
25
vendor/github.com/klauspost/compress/s2/encode.go
generated
vendored
@ -9,6 +9,9 @@ import (
|
||||
"encoding/binary"
|
||||
"math"
|
||||
"math/bits"
|
||||
"sync"
|
||||
|
||||
"github.com/klauspost/compress/internal/race"
|
||||
)
|
||||
|
||||
// Encode returns the encoded form of src. The returned slice may be a sub-
|
||||
@ -52,6 +55,8 @@ func Encode(dst, src []byte) []byte {
|
||||
return dst[:d]
|
||||
}
|
||||
|
||||
var estblockPool [2]sync.Pool
|
||||
|
||||
// EstimateBlockSize will perform a very fast compression
|
||||
// without outputting the result and return the compressed output size.
|
||||
// The function returns -1 if no improvement could be achieved.
|
||||
@ -61,9 +66,25 @@ func EstimateBlockSize(src []byte) (d int) {
|
||||
return -1
|
||||
}
|
||||
if len(src) <= 1024 {
|
||||
d = calcBlockSizeSmall(src)
|
||||
const sz, pool = 2048, 0
|
||||
tmp, ok := estblockPool[pool].Get().(*[sz]byte)
|
||||
if !ok {
|
||||
tmp = &[sz]byte{}
|
||||
}
|
||||
race.WriteSlice(tmp[:])
|
||||
defer estblockPool[pool].Put(tmp)
|
||||
|
||||
d = calcBlockSizeSmall(src, tmp)
|
||||
} else {
|
||||
d = calcBlockSize(src)
|
||||
const sz, pool = 32768, 1
|
||||
tmp, ok := estblockPool[pool].Get().(*[sz]byte)
|
||||
if !ok {
|
||||
tmp = &[sz]byte{}
|
||||
}
|
||||
race.WriteSlice(tmp[:])
|
||||
defer estblockPool[pool].Put(tmp)
|
||||
|
||||
d = calcBlockSize(src, tmp)
|
||||
}
|
||||
|
||||
if d == 0 {
|
||||
|
Reference in New Issue
Block a user