1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-20 16:50:28 -05:00

chore(performance): loadCommentsByType sets Issues

Keep the setting of comment.Issues from the refactor. It is cheap and
potentially saves loading the issue again.

Former title: Some small refactors (#33144)

(cherry picked from commit d3083d21981f9445cf7570956a1fdedfc8578b56)

Conflicts:
	models/issues/comment_list.go
	models/issues/issue_list.go
	routers/web/repo/issue_view.go
This commit is contained in:
Lunny Xiao 2025-01-09 22:00:06 -08:00 committed by Earl Warren
parent d09b8ba9cf
commit f2feb34927
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -268,6 +268,9 @@ func (issue *Issue) loadCommentsByType(ctx context.Context, tp CommentType) (err
IssueID: issue.ID,
Type: tp,
})
for _, comment := range issue.Comments {
comment.Issue = issue
}
return err
}