Commit 045587e0 authored by Robert May's avatar Robert May

Reduce instantiations when building blame

parent 1ccbd72f
......@@ -19,16 +19,18 @@ module Gitlab
commit = Commit.new(commit, project)
commit.lazy_author # preload author
sha = commit.sha
if prev_sha != sha
if prev_sha != commit.sha
groups << current_group if current_group
current_group = { commit: commit, lines: [] }
end
line = highlighted_lines[i].html_safe if highlight
current_group[:lines] << line
if highlight
current_group[:lines] << highlighted_lines[i].html_safe
else
current_group[:lines] << line
end
prev_sha = sha
prev_sha = commit.sha
i += 1
end
groups << current_group if current_group
......
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