Skip to content

Commit 441fd81

Browse files
committed
Don't specify length of ConfigSelection ahead of time
1 parent a120716 commit 441fd81

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/proc.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,12 @@ func FindDirs(path string) ConfigSelection {
2929
names, _ := dir.Readdirnames(-1)
3030
defer dir.Close()
3131

32-
cfg := make(ConfigSelection, len(names))
33-
for k := range names {
34-
resolvedPath := filepath.Join(fullPath, names[k])
35-
if !IsDir(resolvedPath) {
36-
continue
32+
cfg := make(ConfigSelection)
33+
for _, name := range names {
34+
resolvedPath := filepath.Join(fullPath, name)
35+
if IsDir(resolvedPath) {
36+
cfg[resolvedPath] = resolvedPath
3737
}
38-
39-
D := resolvedPath
40-
cfg[D] = D
4138
}
4239
return cfg
4340
}

0 commit comments

Comments
 (0)