summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-22 15:40:36 +0200
committerDouwe Maan <douwe@gitlab.com>2015-10-22 15:40:36 +0200
commitaa4007a597ea6c7de11a8f37de2fd889aa6e6646 (patch)
tree4514cb84e350d7edf15f55bc98374a60a052d78b /lib/gitlab
parent51ed8fd706802fe0fffe7a2db0b5adc1f2196e50 (diff)
downloadgitlab-ce-aa4007a597ea6c7de11a8f37de2fd889aa6e6646.tar.gz
Slight refactoring
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/reference_extractor.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb
index 69c7a0f4779..e5cafebdbc0 100644
--- a/lib/gitlab/reference_extractor.rb
+++ b/lib/gitlab/reference_extractor.rb
@@ -11,6 +11,7 @@ module Gitlab
@load_lazy_references = load_lazy_references
@texts = []
+ @references = {}
end
def analyze(text, options = {})
@@ -19,21 +20,12 @@ module Gitlab
%i(user label issue merge_request snippet commit commit_range).each do |type|
define_method("#{type}s") do
- references[type]
+ @references[type] ||= pipeline_result(type)
end
end
private
- def references
- @references ||= Hash.new do |references, type|
- type = type.to_sym
- next references[type] if references.has_key?(type)
-
- references[type] = pipeline_result(type)
- end
- end
-
# Instantiate and call HTML::Pipeline with a single reference filter type,
# returning the result
#