@@ -99,21 +99,19 @@ func applySorts(sess *xorm.Session, sortType string, priorityRepoID int64) {
9999 }
100100}
101101
102- func applyLimit (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
102+ func applyLimit (sess * xorm.Session , opts * IssuesOptions ) {
103103 if opts .Paginator == nil || opts .Paginator .IsListAll () {
104- return sess
104+ return
105105 }
106106
107107 start := 0
108108 if opts .Paginator .Page > 1 {
109109 start = (opts .Paginator .Page - 1 ) * opts .Paginator .PageSize
110110 }
111111 sess .Limit (opts .Paginator .PageSize , start )
112-
113- return sess
114112}
115113
116- func applyLabelsCondition (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
114+ func applyLabelsCondition (sess * xorm.Session , opts * IssuesOptions ) {
117115 if len (opts .LabelIDs ) > 0 {
118116 if opts .LabelIDs [0 ] == 0 {
119117 sess .Where ("issue.id NOT IN (SELECT issue_id FROM issue_label)" )
@@ -136,11 +134,9 @@ func applyLabelsCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Session
136134 if len (opts .ExcludedLabelNames ) > 0 {
137135 sess .And (builder .NotIn ("issue.id" , BuildLabelNamesIssueIDsCondition (opts .ExcludedLabelNames )))
138136 }
139-
140- return sess
141137}
142138
143- func applyMilestoneCondition (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
139+ func applyMilestoneCondition (sess * xorm.Session , opts * IssuesOptions ) {
144140 if len (opts .MilestoneIDs ) == 1 && opts .MilestoneIDs [0 ] == db .NoConditionID {
145141 sess .And ("issue.milestone_id = 0" )
146142 } else if len (opts .MilestoneIDs ) > 0 {
@@ -153,11 +149,9 @@ func applyMilestoneCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Sess
153149 From ("milestone" ).
154150 Where (builder .In ("name" , opts .IncludeMilestones )))
155151 }
156-
157- return sess
158152}
159153
160- func applyProjectCondition (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
154+ func applyProjectCondition (sess * xorm.Session , opts * IssuesOptions ) {
161155 if opts .ProjectID > 0 { // specific project
162156 sess .Join ("INNER" , "project_issue" , "issue.id = project_issue.issue_id" ).
163157 And ("project_issue.project_id=?" , opts .ProjectID )
@@ -166,21 +160,19 @@ func applyProjectCondition(sess *xorm.Session, opts *IssuesOptions) *xorm.Sessio
166160 }
167161 // opts.ProjectID == 0 means all projects,
168162 // do not need to apply any condition
169- return sess
170163}
171164
172- func applyProjectColumnCondition (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
165+ func applyProjectColumnCondition (sess * xorm.Session , opts * IssuesOptions ) {
173166 // opts.ProjectColumnID == 0 means all project columns,
174167 // do not need to apply any condition
175168 if opts .ProjectColumnID > 0 {
176169 sess .In ("issue.id" , builder .Select ("issue_id" ).From ("project_issue" ).Where (builder.Eq {"project_board_id" : opts .ProjectColumnID }))
177170 } else if opts .ProjectColumnID == db .NoConditionID {
178171 sess .In ("issue.id" , builder .Select ("issue_id" ).From ("project_issue" ).Where (builder.Eq {"project_board_id" : 0 }))
179172 }
180- return sess
181173}
182174
183- func applyRepoConditions (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
175+ func applyRepoConditions (sess * xorm.Session , opts * IssuesOptions ) {
184176 if len (opts .RepoIDs ) == 1 {
185177 opts .RepoCond = builder.Eq {"issue.repo_id" : opts .RepoIDs [0 ]}
186178 } else if len (opts .RepoIDs ) > 1 {
@@ -195,10 +187,9 @@ func applyRepoConditions(sess *xorm.Session, opts *IssuesOptions) *xorm.Session
195187 if opts .RepoCond != nil {
196188 sess .And (opts .RepoCond )
197189 }
198- return sess
199190}
200191
201- func applyConditions (sess * xorm.Session , opts * IssuesOptions ) * xorm. Session {
192+ func applyConditions (sess * xorm.Session , opts * IssuesOptions ) {
202193 if len (opts .IssueIDs ) > 0 {
203194 sess .In ("issue.id" , opts .IssueIDs )
204195 }
@@ -261,8 +252,6 @@ func applyConditions(sess *xorm.Session, opts *IssuesOptions) *xorm.Session {
261252 if opts .User != nil {
262253 sess .And (issuePullAccessibleRepoCond ("issue.repo_id" , opts .User .ID , opts .Org , opts .Team , opts .IsPull .Value ()))
263254 }
264-
265- return sess
266255}
267256
268257// teamUnitsRepoCond returns query condition for those repo id in the special org team with special units access
@@ -339,22 +328,22 @@ func issuePullAccessibleRepoCond(repoIDstr string, userID int64, org *organizati
339328 return cond
340329}
341330
342- func applyAssigneeCondition (sess * xorm.Session , assigneeID int64 ) * xorm. Session {
343- return sess .Join ("INNER" , "issue_assignees" , "issue.id = issue_assignees.issue_id" ).
331+ func applyAssigneeCondition (sess * xorm.Session , assigneeID int64 ) {
332+ sess .Join ("INNER" , "issue_assignees" , "issue.id = issue_assignees.issue_id" ).
344333 And ("issue_assignees.assignee_id = ?" , assigneeID )
345334}
346335
347- func applyPosterCondition (sess * xorm.Session , posterID int64 ) * xorm. Session {
348- return sess .And ("issue.poster_id=?" , posterID )
336+ func applyPosterCondition (sess * xorm.Session , posterID int64 ) {
337+ sess .And ("issue.poster_id=?" , posterID )
349338}
350339
351- func applyMentionedCondition (sess * xorm.Session , mentionedID int64 ) * xorm. Session {
352- return sess .Join ("INNER" , "issue_user" , "issue.id = issue_user.issue_id" ).
340+ func applyMentionedCondition (sess * xorm.Session , mentionedID int64 ) {
341+ sess .Join ("INNER" , "issue_user" , "issue.id = issue_user.issue_id" ).
353342 And ("issue_user.is_mentioned = ?" , true ).
354343 And ("issue_user.uid = ?" , mentionedID )
355344}
356345
357- func applyReviewRequestedCondition (sess * xorm.Session , reviewRequestedID int64 ) * xorm. Session {
346+ func applyReviewRequestedCondition (sess * xorm.Session , reviewRequestedID int64 ) {
358347 existInTeamQuery := builder .Select ("team_user.team_id" ).
359348 From ("team_user" ).
360349 Where (builder.Eq {"team_user.uid" : reviewRequestedID })
@@ -375,11 +364,11 @@ func applyReviewRequestedCondition(sess *xorm.Session, reviewRequestedID int64)
375364 ),
376365 builder .In ("review.id" , maxReview ),
377366 ))
378- return sess .Where ("issue.poster_id <> ?" , reviewRequestedID ).
367+ sess .Where ("issue.poster_id <> ?" , reviewRequestedID ).
379368 And (builder .In ("issue.id" , subQuery ))
380369}
381370
382- func applyReviewedCondition (sess * xorm.Session , reviewedID int64 ) * xorm. Session {
371+ func applyReviewedCondition (sess * xorm.Session , reviewedID int64 ) {
383372 // Query for pull requests where you are a reviewer or commenter, excluding
384373 // any pull requests already returned by the review requested filter.
385374 notPoster := builder.Neq {"issue.poster_id" : reviewedID }
@@ -406,11 +395,11 @@ func applyReviewedCondition(sess *xorm.Session, reviewedID int64) *xorm.Session
406395 builder .In ("type" , CommentTypeComment , CommentTypeCode , CommentTypeReview ),
407396 )),
408397 )
409- return sess .And (notPoster , builder .Or (reviewed , commented ))
398+ sess .And (notPoster , builder .Or (reviewed , commented ))
410399}
411400
412- func applySubscribedCondition (sess * xorm.Session , subscriberID int64 ) * xorm. Session {
413- return sess .And (
401+ func applySubscribedCondition (sess * xorm.Session , subscriberID int64 ) {
402+ sess .And (
414403 builder .
415404 NotIn ("issue.id" ,
416405 builder .Select ("issue_id" ).
0 commit comments