mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: pre-allocate certain slices with expected capacity (#12044)
Avoids append() based tiny allocations on known allocated slices repeated access.
This commit is contained in:
@@ -1147,7 +1147,7 @@ func (z xlMetaV2) TotalSize() int64 {
|
||||
// showPendingDeletes is set to true if ListVersions needs to list objects marked deleted
|
||||
// but waiting to be replicated
|
||||
func (z xlMetaV2) ListVersions(volume, path string) ([]FileInfo, time.Time, error) {
|
||||
var versions []FileInfo
|
||||
versions := make([]FileInfo, 0, len(z.Versions))
|
||||
var err error
|
||||
|
||||
for _, version := range z.Versions {
|
||||
|
||||
Reference in New Issue
Block a user