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:
parent
c232a0f97f
commit
e9cd58f5d5
|
@ -77,11 +77,11 @@ class IssuableFinder
|
||||||
return @projects if defined?(@projects)
|
return @projects if defined?(@projects)
|
||||||
|
|
||||||
if project?
|
if project?
|
||||||
project
|
@projects = project
|
||||||
elsif current_user && params[:authorized_only].presence && !current_user_related?
|
elsif current_user && params[:authorized_only].presence && !current_user_related?
|
||||||
current_user.authorized_projects
|
@projects = current_user.authorized_projects
|
||||||
else
|
else
|
||||||
ProjectsFinder.new.execute(current_user)
|
@projects = ProjectsFinder.new.execute(current_user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue