From cc84ca40d787d853186af6c16d328daa37d543da Mon Sep 17 00:00:00 2001 From: Morlinest Date: Wed, 27 Sep 2017 14:41:52 +0200 Subject: [PATCH] Remove redudant issue LoadAttributes() calls (#2614) --- models/issue.go | 7 +------ routers/api/v1/repo/issue.go | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/models/issue.go b/models/issue.go index 7884507a2..0c68275d4 100644 --- a/models/issue.go +++ b/models/issue.go @@ -984,12 +984,7 @@ func GetIssueByRef(ref string) (*Issue, error) { return nil, err } - issue, err := GetIssueByIndex(repo.ID, index) - if err != nil { - return nil, err - } - - return issue, issue.LoadAttributes() + return GetIssueByIndex(repo.ID, index) } // GetRawIssueByIndex returns raw issue without loading attributes by index in a repository. diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 9f51022f3..2debe67c3 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -39,12 +39,6 @@ func ListIssues(ctx *context.APIContext) { return } - err = models.IssueList(issues).LoadAttributes() - if err != nil { - ctx.Error(500, "LoadAttributes", err) - return - } - apiIssues := make([]*api.Issue, len(issues)) for i := range issues { apiIssues[i] = issues[i].APIFormat()