mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
use slices package and remove some helpers (#17342)
This commit is contained in:
13
cmd/utils.go
13
cmd/utils.go
@@ -32,7 +32,6 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"runtime/trace"
|
||||
@@ -278,18 +277,6 @@ func isMaxPartID(partID int) bool {
|
||||
return partID > globalMaxPartID
|
||||
}
|
||||
|
||||
func contains(slice interface{}, elem interface{}) bool {
|
||||
v := reflect.ValueOf(slice)
|
||||
if v.Kind() == reflect.Slice {
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
if v.Index(i).Interface() == elem {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// profilerWrapper is created becauses pkg/profiler doesn't
|
||||
// provide any API to calculate the profiler file path in the
|
||||
// disk since the name of this latter is randomly generated.
|
||||
|
||||
Reference in New Issue
Block a user