From 1c74612b3c025282d4731880575922c797813ca7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Mon, 1 Feb 2016 20:55:12 -0500 Subject: Minor fix for #2444 --- routers/repo/issue.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'routers/repo') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 3c1f62c2..57852a5a 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -595,10 +595,11 @@ func ViewIssue(ctx *middleware.Context) { ok bool marked = make(map[int64]models.CommentTag) comment *models.Comment - participants []*models.User + participants = make([]*models.User, 1, 10) ) - participants = append(participants, issue.Poster) - // Render comments. (and fetch participants) + + // Render comments and and fetch participants. + participants[0] = issue.Poster for _, comment = range issue.Comments { if comment.Type == models.COMMENT_TYPE_COMMENT { comment.RenderedContent = string(base.RenderMarkdown([]byte(comment.Content), ctx.Repo.RepoLink, @@ -636,6 +637,7 @@ func ViewIssue(ctx *middleware.Context) { } ctx.Data["Participants"] = participants + ctx.Data["NumParticipants"] = len(participants) ctx.Data["Issue"] = issue ctx.Data["IsIssueOwner"] = ctx.Repo.IsAdmin() || (ctx.IsSigned && issue.IsPoster(ctx.User.Id)) ctx.Data["SignInLink"] = setting.AppSubUrl + "/user/login" -- cgit v1.2.3