mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-23 19:46:12 +10:00
Memoize IssuableFinder#projects
Since this method's returned data doesn't change between calls on the same IssuableFinder instance we can just memoize this similar to the "project" method.
This commit is contained in:
@@ -77,11 +77,11 @@ class IssuableFinder
|
||||
return @projects if defined?(@projects)
|
||||
|
||||
if project?
|
||||
project
|
||||
@projects = project
|
||||
elsif current_user && params[:authorized_only].presence && !current_user_related?
|
||||
current_user.authorized_projects
|
||||
@projects = current_user.authorized_projects
|
||||
else
|
||||
ProjectsFinder.new.execute(current_user)
|
||||
@projects = ProjectsFinder.new.execute(current_user)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user