8000 replace Walk with WalkDir · NVIDIA/aistore@12ea066 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 12ea066

Browse files
Gofastasfalex-aizman
authored andcommitted
replace Walk with WalkDir
* Avoid lstat call on every file accessed Signed-off-by: Gofastasf <gofastasf@gmail.com>
1 parent d659b2e commit 12ea066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ais/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func cleanupConfigDir(name string, keepInitialConfig bool) {
426426
cos.RemoveFile(daemon.cli.localConfigPath)
427427
}
428428
config := cmn.GCO.Get()
429-
filepath.Walk(config.ConfigDir, func(path string, finfo os.FileInfo, _ error) error {
429+
filepath.WalkDir(config.ConfigDir, func(path string, finfo os.DirEntry, _ error) error {
430430
if strings.HasPrefix(finfo.Name(), ".ais.") {
431431
if err := cos.RemoveFile(path); err != nil {
432432
nlog.Errorf("%s: failed to cleanup %q, err: %v", name, path, err)

0 commit comments

Comments
 (0)
0