aboutsummaryrefslogtreecommitdiff
path: root/models/pull.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-17 19:17:40 -0400
committerUnknwon <u@gogs.io>2017-03-17 19:17:40 -0400
commitcac7af2c783e12b68e8263b57a150d19f085f4da (patch)
tree102491e2450d81a414e464523768337c495e6f8c /models/pull.go
parent2d4dc544bea95239f620246610ccd9ed0a0ffd46 (diff)
explore: able list and search for private but accessible repositories (#3088)
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/models/pull.go b/models/pull.go
index 454a2a18..9db6791b 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -620,16 +620,18 @@ func (prs PullRequestList) loadAttributes(e Engine) (err error) {
}
// Load issues
- issueIDs := make([]int64, 0, len(prs))
+ set := make(map[int64]*Issue)
for i := range prs {
- issueIDs = append(issueIDs, prs[i].IssueID)
+ set[prs[i].IssueID] = nil
+ }
+ issueIDs := make([]int64, 0, len(prs))
+ for issueID := range set {
+ issueIDs = append(issueIDs, issueID)
}
issues := make([]*Issue, 0, len(issueIDs))
if err = e.Where("id > 0").In("id", issueIDs).Find(&issues); err != nil {
return fmt.Errorf("find issues: %v", err)
}
-
- set := make(map[int64]*Issue)
for i := range issues {
set[issues[i].ID] = issues[i]
}