From fd1063132f645407cc935b06ea91ae34c6f926b7 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 Apr 2022 20:13:26 +0200 Subject: [PATCH] refactor(changelog): clean up author map --- internal/changelog/changelog.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/internal/changelog/changelog.go b/internal/changelog/changelog.go index 1a178f6..9e548f0 100644 --- a/internal/changelog/changelog.go +++ b/internal/changelog/changelog.go @@ -157,17 +157,11 @@ func (c *Changelog) GenerateChangelog(templateConfig shared.ChangelogTemplateCon } } - authors := map[string]int{} + authors := map[string]bool{} for _, commits := range analyzedCommits { for _, commit := range commits { - - _, ok := authors[commit.Commit.Author] - if !ok { - authors[commit.Commit.Author] = 0 - } - authors[commit.Commit.Author] = authors[commit.Commit.Author] + 1 - + authors[commit.Commit.Author] = true if commit.Print { if commit.IsBreaking { commitsBreakingChange = append(commitsBreakingChange, commit)