Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 1252267

Browse files
William Douglasbryteise
authored andcommitted
Avoid defining chrootDir in a loop
Variable doesn't need to be redefined each iteration, declare it outside the loop. Signed-off-by: William Douglas <william.douglas@intel.com>
1 parent e5e00e3 commit 1252267

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

swupd/manifest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ func (m *Manifest) addManifestFiles(ui UpdateInfo, c config) error {
755755
}
756756
} else {
757757
// Add files to manifest that do not exist in included bundles.
758+
chrootDir := filepath.Join(c.imageBase, fmt.Sprint(ui.version), "full")
758759
includes := m.GetRecursiveIncludes()
759760
for f := range m.BundleInfo.Files {
760761
isIncluded := false
@@ -763,7 +764,6 @@ func (m *Manifest) addManifestFiles(ui UpdateInfo, c config) error {
763764
if inc.Name == m.Name {
764765
continue
765766
}
766-
chrootDir := filepath.Join(c.imageBase, fmt.Sprint(ui.version), "full")
767767
fullPath := filepath.Join(chrootDir, f)
768768
if fi, err := os.Lstat(fullPath); err == nil {
769769
if !fi.IsDir() {

0 commit comments

Comments
 (0)