Skip to content

Commit 2b45c03

Browse files
committed
CHORE Code refactoring
1 parent 963d19a commit 2b45c03

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,17 @@ func loadFileInfos(dir string, infoExtractor func(os.DirEntry) (os.FileInfo, err
5959

6060
files := make([]file, 0, len(fileList))
6161
for i := range fileList {
62-
if strings.HasPrefix(fileList[i].Name(), segPrefix) && !strings.HasSuffix(fileList[i].Name(), segOffsetFileSuffix) {
62+
fileName := fileList[i].Name()
63+
64+
if strings.HasPrefix(fileName, segPrefix) &&
65+
!strings.HasSuffix(fileName, segOffsetFileSuffix) {
66+
// extract file info
6367
info, e := infoExtractor(fileList[i])
6468
if e != nil {
6569
return nil, e
6670
}
6771

72+
// add to list
6873
files = append(files, file{
6974
path: filepath.Join(dir, fileList[i].Name()),
7075
modTime: info.ModTime(),

0 commit comments

Comments
 (0)