mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 21:40:28 +01:00
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
This commit is contained in:
@@ -530,7 +530,6 @@ Performance/FixedSize:
|
|||||||
Performance/RedundantBlockCall:
|
Performance/RedundantBlockCall:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/controllers/application_controller.rb'
|
- 'app/controllers/application_controller.rb'
|
||||||
- 'lib/redmine/views/builders/structure.rb'
|
|
||||||
- 'test/functional/repositories_git_controller_test.rb'
|
- 'test/functional/repositories_git_controller_test.rb'
|
||||||
|
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module Redmine
|
|||||||
|
|
||||||
def array(tag, options={}, &block)
|
def array(tag, options={}, &block)
|
||||||
@struct << []
|
@struct << []
|
||||||
block.call(self)
|
yield(self)
|
||||||
ret = @struct.pop
|
ret = @struct.pop
|
||||||
@struct.last[tag] = ret
|
@struct.last[tag] = ret
|
||||||
@struct.last.merge!(options) if options
|
@struct.last.merge!(options) if options
|
||||||
@@ -72,7 +72,7 @@ module Redmine
|
|||||||
|
|
||||||
if block
|
if block
|
||||||
@struct << (args.first.is_a?(Hash) ? args.first : {})
|
@struct << (args.first.is_a?(Hash) ? args.first : {})
|
||||||
block.call(self)
|
yield(self)
|
||||||
ret = @struct.pop
|
ret = @struct.pop
|
||||||
if @struct.last.is_a?(Array)
|
if @struct.last.is_a?(Array)
|
||||||
@struct.last << ret
|
@struct.last << ret
|
||||||
|
|||||||
Reference in New Issue
Block a user