From deec3516d53e9a9679128ade0556ccc818a67be1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 16:33:45 +0800 Subject: autofix: fix check for empty string (#6804) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/db/action.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/db/action.go') diff --git a/internal/db/action.go b/internal/db/action.go index a9efeeb8..970ff203 100644 --- a/internal/db/action.go +++ b/internal/db/action.go @@ -325,7 +325,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err ref = strings.TrimSpace(ref) ref = strings.TrimRightFunc(ref, issueIndexTrimRight) - if len(ref) == 0 { + if ref == "" { continue } @@ -368,7 +368,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err ref = ref[strings.IndexByte(ref, byte(' '))+1:] ref = strings.TrimRightFunc(ref, issueIndexTrimRight) - if len(ref) == 0 { + if ref == "" { continue } @@ -407,7 +407,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err ref = ref[strings.IndexByte(ref, byte(' '))+1:] ref = strings.TrimRightFunc(ref, issueIndexTrimRight) - if len(ref) == 0 { + if ref == "" { continue } -- cgit v1.2.3