Memoize old_blob and new_blob to improve performance

This commit is contained in:
Igor 2019-03-28 12:11:37 +00:00 committed by Douwe Maan
parent b8e9a3797f
commit db68003e8b

View file

@ -133,12 +133,16 @@ module Gitlab
end
def new_blob
strong_memoize(:new_blob) do
new_blob_lazy&.itself
end
end
def old_blob
strong_memoize(:old_blob) do
old_blob_lazy&.itself
end
end
def new_blob_lines_between(from_line, to_line)
return [] unless new_blob