Commit db68003e authored by Igor's avatar Igor Committed by Douwe Maan

Memoize old_blob and new_blob to improve performance

parent b8e9a379
...@@ -133,12 +133,16 @@ module Gitlab ...@@ -133,12 +133,16 @@ module Gitlab
end end
def new_blob def new_blob
strong_memoize(:new_blob) do
new_blob_lazy&.itself new_blob_lazy&.itself
end end
end
def old_blob def old_blob
strong_memoize(:old_blob) do
old_blob_lazy&.itself old_blob_lazy&.itself
end end
end
def new_blob_lines_between(from_line, to_line) def new_blob_lines_between(from_line, to_line)
return [] unless new_blob return [] unless new_blob
......
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