mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Preallocate (safe) slices when we know the size (#10459)
This commit is contained in:
@@ -654,7 +654,7 @@ func listVols(dirPath string) ([]VolInfo, error) {
|
||||
if err != nil {
|
||||
return nil, errDiskNotFound
|
||||
}
|
||||
var volsInfo []VolInfo
|
||||
volsInfo := make([]VolInfo, 0, len(entries))
|
||||
for _, entry := range entries {
|
||||
if !HasSuffix(entry, SlashSeparator) || !isValidVolname(slashpath.Clean(entry)) {
|
||||
// Skip if entry is neither a directory not a valid volume name.
|
||||
|
||||
Reference in New Issue
Block a user