mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -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:
@@ -612,7 +612,7 @@ func (s *erasureSets) StorageInfo(ctx context.Context) (StorageInfo, []error) {
|
||||
storageInfo.Disks = append(storageInfo.Disks, lstorageInfo.Disks...)
|
||||
}
|
||||
|
||||
var errs []error
|
||||
errs := make([]error, 0, len(s.sets)*s.setDriveCount)
|
||||
for i := range s.sets {
|
||||
errs = append(errs, storageInfoErrs[i]...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user