mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-20 05:26:53 +00:00
playback: improve performance (#4152)
* change from filepath.Walk to filepath.WalkDir * use filepath.WalkDir in the entire project --------- Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
This commit is contained in:
parent
116f275ef5
commit
1f33b5b2ba
@ -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
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user