Skip to content

Commit

Permalink
chore: slice replace loop (#21064)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Jun 28, 2023
1 parent 32b72b4 commit 36f69d8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions eng/tools/internal/report/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,13 @@ func (c *CommitPkgsReport) UpdateAffectedPackages(commit string, r PkgsReport) {
c.AffectedPackages = map[string]PkgsList{}
}

for _, pkg := range r.AddedPackages {
c.AffectedPackages[commit] = append(c.AffectedPackages[commit], pkg)
}
c.AffectedPackages[commit] = append(c.AffectedPackages[commit], r.AddedPackages...)

for pkgName := range r.ModifiedPackages {
c.AffectedPackages[commit] = append(c.AffectedPackages[commit], pkgName)
}

for _, pkg := range r.RemovedPackages {
c.AffectedPackages[commit] = append(c.AffectedPackages[commit], pkg)
}
c.AffectedPackages[commit] = append(c.AffectedPackages[commit], r.RemovedPackages...)
}

// PkgsReport represents a complete report of added, removed, and modified packages
Expand Down

0 comments on commit 36f69d8

Please sign in to comment.