@@ -81,19 +81,21 @@ func GetIssueWatchers(issueID int64, listOptions ListOptions) (IssueWatchList, e
81
81
return getIssueWatchers (x , issueID , listOptions )
82
82
}
83
83
84
- func getIssueWatchers (e Engine , issueID int64 , listOptions ListOptions ) (watches IssueWatchList , err error ) {
84
+ func getIssueWatchers (e Engine , issueID int64 , listOptions ListOptions ) (IssueWatchList , error ) {
85
85
sess := e .
86
86
Where ("`issue_watch`.issue_id = ?" , issueID ).
87
87
And ("`issue_watch`.is_watching = ?" , true ).
88
88
And ("`user`.is_active = ?" , true ).
89
89
And ("`user`.prohibit_login = ?" , false ).
90
90
Join ("INNER" , "`user`" , "`user`.id = `issue_watch`.user_id" )
91
91
92
- if listOptions .Page = = 0 {
92
+ if listOptions .Page ! = 0 {
93
93
sess = listOptions .setSessionPagination (sess )
94
+ watches := make ([]* IssueWatch , 0 , listOptions .PageSize )
95
+ return watches , sess .Find (& watches )
94
96
}
95
- err = sess . Find ( & watches )
96
- return
97
+ watches := make ([] * IssueWatch , 0 , 8 )
98
+ return watches , sess . Find ( & watches )
97
99
}
98
100
99
101
func removeIssueWatchersByRepoID (e Engine , userID int64 , repoID int64 ) error {
0 commit comments