mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 12:54:04 +01:00
Remove redudant issue LoadAttributes() calls (#2614)
This commit is contained in:
parent
339d7de409
commit
cc84ca40d7
2 changed files with 1 additions and 12 deletions
|
@ -984,12 +984,7 @@ func GetIssueByRef(ref string) (*Issue, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
issue, err := GetIssueByIndex(repo.ID, index)
|
return GetIssueByIndex(repo.ID, index)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return issue, issue.LoadAttributes()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRawIssueByIndex returns raw issue without loading attributes by index in a repository.
|
// GetRawIssueByIndex returns raw issue without loading attributes by index in a repository.
|
||||||
|
|
|
@ -39,12 +39,6 @@ func ListIssues(ctx *context.APIContext) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = models.IssueList(issues).LoadAttributes()
|
|
||||||
if err != nil {
|
|
||||||
ctx.Error(500, "LoadAttributes", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
apiIssues := make([]*api.Issue, len(issues))
|
apiIssues := make([]*api.Issue, len(issues))
|
||||||
for i := range issues {
|
for i := range issues {
|
||||||
apiIssues[i] = issues[i].APIFormat()
|
apiIssues[i] = issues[i].APIFormat()
|
||||||
|
|
Loading…
Reference in a new issue