Skip to content

Commit

Permalink
simplify filter loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Egari authored and dadav committed Dec 28, 2024
1 parent 3126393 commit bf495ba
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions internal/v3/api/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,15 @@ func (s *ReleaseOperationsApi) GetReleases(ctx context.Context, limit int32, off
if filterSet {
// We search through all available releases to see if they match the filter
for _, r := range prefiltered {
filterMatched := true

if module != "" && r.Module.Slug != module {
filterMatched = false
continue
}

if owner != "" && r.Module.Owner.Slug != owner {
filterMatched = false
continue
}

if filterMatched {
filtered = append(filtered, r)
}
filtered = append(filtered, r)
}
} else {
filtered = prefiltered
Expand Down

0 comments on commit bf495ba

Please sign in to comment.