summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-02-03 00:27:10 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-02-03 13:27:10 +0800
commit400b6fd61c6a1cea590c1b264b588d9a2b0cae28 (patch)
treea4a22ceb8e4307fe7b851be50d3ceae270fa327f
parentbf6f61cc690978bcad416ace8e8da2418602cbf3 (diff)
downloadgitea-400b6fd61c6a1cea590c1b264b588d9a2b0cae28.tar.gz
gitea-400b6fd61c6a1cea590c1b264b588d9a2b0cae28.zip
Cache ctxUser in retrieveFeeds(..) (#826)
-rw-r--r--routers/user/home.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index 66ee6570c0..e043f67bea 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -65,7 +65,9 @@ func retrieveFeeds(ctx *context.Context, ctxUser *models.User, userID, offset in
// Check access of private repositories.
feeds := make([]*models.Action, 0, len(actions))
- unameAvatars := make(map[string]string)
+ unameAvatars := map[string]string{
+ ctxUser.Name: ctxUser.RelAvatarLink(),
+ }
for _, act := range actions {
// Cache results to reduce queries.
_, ok := unameAvatars[act.ActUserName]