Merge pull request #29563 from vishnukothakapu/perf-walkdir

Performance: Upgrade filepath.Walk to filepath.WalkDir
This commit is contained in:
Paul Holzinger 2026-08-20 19:04:21 +02:00 • committed by GitHub
commit e9b8854cf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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