Memoize old_blob and new_blob to improve performance
This commit is contained in:
parent
b8e9a3797f
commit
db68003e8b
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue