Commit 3d355cec authored by Robert Speicher's avatar Robert Speicher

Merge branch '217580-improve-blob-show-performance' into 'master'

Improve BlobController show.json performance: cache method calls

See merge request gitlab-org/gitlab!33876
parents 01263b0c 56f3dcd9
......@@ -675,6 +675,7 @@ class Project < ApplicationRecord
# '>' or its escaped form ('&gt;') are checked for because '>' is sometimes escaped
# when the reference comes from an external source.
def markdown_reference_pattern
@markdown_reference_pattern ||=
%r{
#{reference_pattern}
(#{reference_postfix}|#{reference_postfix_escaped})
......
......@@ -619,6 +619,7 @@ class User < ApplicationRecord
# Pattern used to extract `@user` user references from text
def reference_pattern
@reference_pattern ||=
%r{
(?<!\w)
#{Regexp.escape(reference_prefix)}
......
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