Skip to content

Commit

Permalink
test ordering
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Jul 27, 2023
1 parent eafd2f5 commit 239925f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,14 @@ func (p *Policy) updateAllChecksums(ctx context.Context,
}

// CHECKS (must be sorted)
sort.Slice(group.Checks, func(i, j int) bool {
return group.Checks[i].Mrn < group.Checks[j].Mrn
checks := group.Checks

sort.Slice(checks, func(i, j int) bool {
return checks[i].Mrn < checks[j].Mrn
})

for i := range group.Checks {
check := group.Checks[i]
for i := range checks {
check := checks[i]

if base, ok := bundle.Queries[check.Mrn]; ok {
check = check.Merge(base)
Expand Down

0 comments on commit 239925f

Please sign in to comment.