Browse Source

code cleanup: rubocop: fix Performance/RedundantBlockCall in lib/redmine/views/builders/structure.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18813 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.1.0
Toshi MARUYAMA 4 years ago
parent
commit
030dbc7218
2 changed files with 2 additions and 3 deletions
  1. 0
    1
      .rubocop_todo.yml
  2. 2
    2
      lib/redmine/views/builders/structure.rb

+ 0
- 1
.rubocop_todo.yml View File

@@ -530,7 +530,6 @@ Performance/FixedSize:
Performance/RedundantBlockCall:
Exclude:
- 'app/controllers/application_controller.rb'
- 'lib/redmine/views/builders/structure.rb'
- 'test/functional/repositories_git_controller_test.rb'

# Cop supports --auto-correct.

+ 2
- 2
lib/redmine/views/builders/structure.rb View File

@@ -32,7 +32,7 @@ module Redmine

def array(tag, options={}, &block)
@struct << []
block.call(self)
yield(self)
ret = @struct.pop
@struct.last[tag] = ret
@struct.last.merge!(options) if options
@@ -72,7 +72,7 @@ module Redmine

if block
@struct << (args.first.is_a?(Hash) ? args.first : {})
block.call(self)
yield(self)
ret = @struct.pop
if @struct.last.is_a?(Array)
@struct.last << ret

Loading…
Cancel
Save