Commit 141459b9 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Memoize using defined? instead ||= operator

parent 096b2c53
......@@ -46,7 +46,9 @@ module IssueLinks
end
def can_destroy_issue_link_on_current_project?
@can_destroy_on_current_project ||= can_destroy_issue_link?(@project)
return @can_destroy_on_current_project if defined?(@can_destroy_on_current_project)
@can_destroy_on_current_project = can_destroy_issue_link?(@project)
end
def can_destroy_issue_link?(project)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment