Avoid unnecessary usage of local vars

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-10-01 15:51:28 +02:00
parent 0d967bce57
commit e2576d588f
No known key found for this signature in database
GPG key ID: 161B5D6A44D3D88A
2 changed files with 3 additions and 6 deletions

View file

@ -8,10 +8,7 @@
.btn-group
= inline_diff_btn
= parallel_diff_btn
- additions = diff_files.sum(&:added_lines)
- deletions = diff_files.sum(&:removed_lines)
= render 'projects/diffs/stats', diff_files: diff_files,
additions: additions, deletions: deletions
= render 'projects/diffs/stats', diff_files: diff_files
- if diff_files.count < diffs.size
= render 'projects/diffs/warning', diffs: diffs, shown_files_count: diff_files.count

View file

@ -4,9 +4,9 @@
= link_to '#', class: 'js-toggle-button' do
%strong #{pluralize(diff_files.count, "changed file")}
with
%strong.cgreen #{additions} additions
%strong.cgreen #{diff_files.sum(&:added_lines)} additions
and
%strong.cred #{deletions} deletions
%strong.cred #{diff_files.sum(&:removed_lines)} deletions
.file-stats.js-toggle-content.hide
%ul
- diff_files.each_with_index do |diff_file, i|