mirror of
https://github.com/nxshock/backuper.git
synced 2024-11-28 00:21:02 +05:00
Speedup filesystem walking by removing calling os.Lstat on each item
This commit is contained in:
parent
8762ea898f
commit
959a356153
@ -348,7 +348,7 @@ func (b *Config) index() (*Index, error) {
|
|||||||
fileMask := filepath.Join(filepath.Dir(b.filePath), b.FileName+"*"+defaultExt)
|
fileMask := filepath.Join(filepath.Dir(b.filePath), b.FileName+"*"+defaultExt)
|
||||||
|
|
||||||
var files []string
|
var files []string
|
||||||
err := filepath.Walk(filepath.Dir(b.filePath), func(path string, info os.FileInfo, err error) error {
|
err := filepath.WalkDir(filepath.Dir(b.filePath), func(path string, info os.DirEntry, err error) error {
|
||||||
matched, err := filepath.Match(fileMask, path)
|
matched, err := filepath.Match(fileMask, path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("filepath.Match: %v", err)
|
return fmt.Errorf("filepath.Match: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user