From b6aa9ba3fccd72f44fe50af1154d7021d4b5498a Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Tue, 3 Jan 2023 15:25:57 +0900 Subject: [PATCH 9/9] Fix RuboCop offense Performance/Sum --- .rubocop_todo.yml | 6 ------ app/helpers/issues_helper.rb | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9ff640eb4..f4444f78d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -486,12 +486,6 @@ Naming/VariableNumber: - 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb' - 'test/unit/project_test.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: OnlySumOrWithInitialValue. -Performance/Sum: - Exclude: - - 'app/helpers/issues_helper.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Include. # Include: app/models/**/*.rb diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 98fe05309..ed041d145 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -343,9 +343,11 @@ module IssuesHelper end def to_html + # rubocop:disable Performance/Sum content = content_tag('div', @left.reduce(&:+), :class => 'splitcontentleft') + content_tag('div', @right.reduce(&:+), :class => 'splitcontentleft') + # rubocop:enable Performance/Sum content_tag('div', content, :class => 'splitcontent') end -- 2.39.0