From 7f06f2afd02d0deeafd90cfef9334a0f78edb5ff Mon Sep 17 00:00:00 2001 From: Florian Weikert Date: Mon, 25 Nov 2024 15:42:29 +0100 Subject: [PATCH] Apply minimal indentation principle --- repositories/gcs.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/repositories/gcs.go b/repositories/gcs.go index 396d059..025b82f 100644 --- a/repositories/gcs.go +++ b/repositories/gcs.go @@ -159,15 +159,13 @@ func (gcs *GCSRepo) matchingVersions(history []string, opts *core.FilterOpts) ([ versions := getVersionsFromGCSPrefixes(prefixes) for vpos := len(versions) - 1; vpos >= 0; vpos-- { curr := versions[vpos] - if strings.Contains(curr, "rolling") { + if strings.Contains(curr, "rolling") || !opts.Filter(curr) { continue } - if opts.Filter(curr) { - descendingMatches = append(descendingMatches, curr) - if len(descendingMatches) == opts.MaxResults { - return descendingMatches, nil - } + descendingMatches = append(descendingMatches, curr) + if len(descendingMatches) == opts.MaxResults { + return descendingMatches, nil } } }