NumProcs() just counts files under f, so use f.Readdirnames to avoid `lstat` syscall inside f.Readdir.

This commit is contained in:
Asato Wakisaka 2017-05-25 00:04:41 +09:00
parent fd7db8b441
commit 16a38100b3
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ func NumProcs() (uint64, error) {
} }
defer f.Close() defer f.Close()
list, err := f.Readdir(-1) list, err := f.Readdirnames(-1)
if err != nil { if err != nil {
return 0, err return 0, err
} }