mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
use Access() instead of Lstat() for frequent use (#11911)
using Lstat() is causing tiny memory allocations, that are usually wasted and never used, instead we can simply uses Access() call that does 0 memory allocations.
This commit is contained in:
@@ -24,6 +24,11 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func access(name string) error {
|
||||
_, err := os.Lstat(name)
|
||||
return err
|
||||
}
|
||||
|
||||
// Return all the entries at the directory dirPath.
|
||||
func readDir(dirPath string) (entries []string, err error) {
|
||||
return readDirN(dirPath, -1)
|
||||
|
||||
Reference in New Issue
Block a user