diff --git a/obs-staging-bot/main.go b/obs-staging-bot/main.go index 9519dc5..18f81bb 100644 --- a/obs-staging-bot/main.go +++ b/obs-staging-bot/main.go @@ -133,10 +133,10 @@ func processBuildStatus(h *common.RequestHandler, project, refProject *common.Bu slices.SortFunc(refProject.Result, BuildResultSorter) h.Log("comparing results %d vs. ref %d", len(project.Result), len(refProject.Result)) -done: for i := 0; i < len(project.Result); i++ { h.Log("searching for %s/%s", project.Result[i].Repository, project.Result[i].Arch) j := 0 + found: for ; j < len(refProject.Result); j++ { if project.Result[i].Repository != refProject.Result[j].Repository || project.Result[i].Arch != refProject.Result[j].Arch { @@ -147,10 +147,7 @@ done: res := processRepoBuildStatus(h, project.Result[i].Status, refProject.Result[j].Status) switch res { case BuildStatusSummarySuccess: - if i == len(project.Result)-1 { - break done - } - break + break found default: return res }