mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-11-03 09:37:34 +00:00
Merge pull request #29563 from vishnukothakapu/perf-walkdir
Performance: Upgrade filepath.Walk to filepath.WalkDir
This commit is contained in:
commit
e9b8854cf4
1 changed files with 3 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
|
@ -100,11 +101,11 @@ func extractQuadletFiles(tempDir string, r io.ReadCloser) ([]string, error) {
|
|||
|
||||
// Collect all files from the extracted directory
|
||||
var filePaths []string
|
||||
err = filepath.Walk(quadletDir, func(path string, info os.FileInfo, err error) error {
|
||||
err = filepath.WalkDir(quadletDir, func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !info.IsDir() {
|
||||
if !d.IsDir() {
|
||||
filePaths = append(filePaths, path)
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue