BigW Consortium Gitlab

Avoid unnecessary usage of local vars

parent 0d967bce
...@@ -8,10 +8,7 @@ ...@@ -8,10 +8,7 @@
.btn-group .btn-group
= inline_diff_btn = inline_diff_btn
= parallel_diff_btn = parallel_diff_btn
- additions = diff_files.sum(&:added_lines) = render 'projects/diffs/stats', diff_files: diff_files
- deletions = diff_files.sum(&:removed_lines)
= render 'projects/diffs/stats', diff_files: diff_files,
additions: additions, deletions: deletions
- if diff_files.count < diffs.size - if diff_files.count < diffs.size
= render 'projects/diffs/warning', diffs: diffs, shown_files_count: diff_files.count = render 'projects/diffs/warning', diffs: diffs, shown_files_count: diff_files.count
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
= link_to '#', class: 'js-toggle-button' do = link_to '#', class: 'js-toggle-button' do
%strong #{pluralize(diff_files.count, "changed file")} %strong #{pluralize(diff_files.count, "changed file")}
with with
%strong.cgreen #{additions} additions %strong.cgreen #{diff_files.sum(&:added_lines)} additions
and and
%strong.cred #{deletions} deletions %strong.cred #{diff_files.sum(&:removed_lines)} deletions
.file-stats.js-toggle-content.hide .file-stats.js-toggle-content.hide
%ul %ul
- diff_files.each_with_index do |diff_file, i| - diff_files.each_with_index do |diff_file, i|
......
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