From 54d96c79b5b9f3d5d47aed59729ae779968fbecb Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 23 Jul 2019 20:50:39 +0200 Subject: Removed unnecessary conversions (#7557) No need to convert to the same type. --- models/action.go | 8 ++++---- models/repo_permission.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'models') diff --git a/models/action.go b/models/action.go index a092f564bf..c819c286e2 100644 --- a/models/action.go +++ b/models/action.go @@ -500,7 +500,7 @@ func getIssueFromRef(repo *Repository, ref string) (*Issue, error) { return nil, nil } - issue, err := GetIssueByIndex(refRepo.ID, int64(issueIndex)) + issue, err := GetIssueByIndex(refRepo.ID, issueIndex) if err != nil { if IsErrIssueNotExist(err) { return nil, nil @@ -565,7 +565,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra // issue is from another repo if len(m[1]) > 0 && len(m[2]) > 0 { - refRepo, err = GetRepositoryFromMatch(string(m[1]), string(m[2])) + refRepo, err = GetRepositoryFromMatch(m[1], m[2]) if err != nil { continue } @@ -602,7 +602,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra // issue is from another repo if len(m[1]) > 0 && len(m[2]) > 0 { - refRepo, err = GetRepositoryFromMatch(string(m[1]), string(m[2])) + refRepo, err = GetRepositoryFromMatch(m[1], m[2]) if err != nil { continue } @@ -631,7 +631,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra // issue is from another repo if len(m[1]) > 0 && len(m[2]) > 0 { - refRepo, err = GetRepositoryFromMatch(string(m[1]), string(m[2])) + refRepo, err = GetRepositoryFromMatch(m[1], m[2]) if err != nil { continue } diff --git a/models/repo_permission.go b/models/repo_permission.go index 25239f4dd4..916678d168 100644 --- a/models/repo_permission.go +++ b/models/repo_permission.go @@ -113,7 +113,7 @@ func (p *Permission) ColorFormat(s fmt.State) { configBytes, err := unit.Config.ToDB() config = string(configBytes) if err != nil { - config = string(err.Error()) + config = err.Error() } } format += "\nUnits[%d]: ID: %d RepoID: %d Type: %-v Config: %s" -- cgit v1.2.3