Merge branch 'id-get-blobs-performance' into 'master'

Memoize old_blob and new_blob to improve performance

See merge request gitlab-org/gitlab-ce!26604
This commit is contained in:
Douwe Maan 2019-03-28 12:11:38 +00:00
commit a85fd76f52
1 changed files with 6 additions and 2 deletions

View File

@ -133,11 +133,15 @@ module Gitlab
end
def new_blob
new_blob_lazy&.itself
strong_memoize(:new_blob) do
new_blob_lazy&.itself
end
end
def old_blob
old_blob_lazy&.itself
strong_memoize(:old_blob) do
old_blob_lazy&.itself
end
end
def new_blob_lines_between(from_line, to_line)