NumProcs() just counts files under f, so use f.Readdirnames to avoid `lstat` syscall inside f.Readdir.
This commit is contained in:
parent
fd7db8b441
commit
16a38100b3
|
@ -35,7 +35,7 @@ func NumProcs() (uint64, error) {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
list, err := f.Readdir(-1)
|
||||
list, err := f.Readdirnames(-1)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue