mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
tests: Do not allow forced type asserts (#20905)
This commit is contained in:
@@ -26,12 +26,12 @@ import (
|
||||
"io"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cespare/xxhash/v2"
|
||||
"github.com/google/uuid"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/minio/minio/internal/bpool"
|
||||
"github.com/minio/minio/internal/bucket/lifecycle"
|
||||
"github.com/minio/minio/internal/bucket/replication"
|
||||
"github.com/minio/minio/internal/config/storageclass"
|
||||
@@ -703,18 +703,17 @@ func (j xlMetaV2Object) ToFileInfo(volume, path string, allParts bool) (FileInfo
|
||||
const metaDataReadDefault = 4 << 10
|
||||
|
||||
// Return used metadata byte slices here.
|
||||
var metaDataPool = sync.Pool{New: func() interface{} { return make([]byte, 0, metaDataReadDefault) }}
|
||||
var metaDataPool = bpool.Pool[[]byte]{New: func() []byte { return make([]byte, 0, metaDataReadDefault) }}
|
||||
|
||||
// metaDataPoolGet will return a byte slice with capacity at least metaDataReadDefault.
|
||||
// It will be length 0.
|
||||
func metaDataPoolGet() []byte {
|
||||
return metaDataPool.Get().([]byte)[:0]
|
||||
return metaDataPool.Get()[:0]
|
||||
}
|
||||
|
||||
// metaDataPoolPut will put an unused small buffer back into the pool.
|
||||
func metaDataPoolPut(buf []byte) {
|
||||
if cap(buf) >= metaDataReadDefault && cap(buf) < metaDataReadDefault*4 {
|
||||
//nolint:staticcheck // SA6002 we are fine with the tiny alloc
|
||||
metaDataPool.Put(buf)
|
||||
}
|
||||
}
|
||||
@@ -1982,7 +1981,6 @@ func mergeXLV2Versions(quorum int, strict bool, requestedVersions int, versions
|
||||
if !latest.header.FreeVersion() {
|
||||
nVersions++
|
||||
}
|
||||
|
||||
} else {
|
||||
// Find latest.
|
||||
var latestCount int
|
||||
|
||||
Reference in New Issue
Block a user