Skip to content

Commit

Permalink
playback: improve performance (#4152)
Browse files Browse the repository at this point in the history
* change from filepath.Walk to filepath.WalkDir

* use filepath.WalkDir in the entire project

---------

Co-authored-by: aler9 <[email protected]>
  • Loading branch information
ijessen-mitll and aler9 authored Jan 17, 2025
1 parent 116f275 commit 1f33b5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/recordstore/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func fixedPathHasSegments(pathConf *conf.Path) bool {

commonPath := CommonPath(recordPath)

err := filepath.Walk(commonPath, func(fpath string, info fs.FileInfo, err error) error {
err := filepath.WalkDir(commonPath, func(fpath string, info fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func regexpPathFindPathsWithSegments(pathConf *conf.Path) map[string]struct{} {

ret := make(map[string]struct{})

filepath.Walk(commonPath, func(fpath string, info fs.FileInfo, err error) error { //nolint:errcheck
filepath.WalkDir(commonPath, func(fpath string, info fs.DirEntry, err error) error { //nolint:errcheck
if err != nil {
return err
}
Expand Down Expand Up @@ -136,7 +136,7 @@ func FindSegments(
commonPath := CommonPath(recordPath)
var segments []*Segment

err := filepath.Walk(commonPath, func(fpath string, info fs.FileInfo, err error) error {
err := filepath.WalkDir(commonPath, func(fpath string, info fs.DirEntry, err error) error {
if err != nil {
return err
}
Expand Down

0 comments on commit 1f33b5b

Please sign in to comment.