Skip to content

Commit

Permalink
installer/installer.go: Avoid extra memory allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
livingsilver94 committed Nov 5, 2023
1 parent a2fbd2a commit 2a5649d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ func (inst *Installer) Install(srv *service.Service) error {
return err
}
for level := depGraph.Depth() - 1; level >= 0; level-- {
for _, dep := range depGraph.Level(level).Slice() {
err := inst.installSingle(dep)
if err != nil {
return err
}
depGraph.Level(level).ForEach(func(dep *service.Service) bool {
err = inst.installSingle(dep)
return err == nil
})
if err != nil {
return err
}
}
return inst.installSingle(srv)
Expand Down

0 comments on commit 2a5649d

Please sign in to comment.