Actions
Patch #32308
closedRubocop: Performance/RedundantBlockCall: Use yield instead of block.call.
Status:
Closed
Priority:
Normal
Assignee:
Toshi MARUYAMA
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Offenses:
lib/redmine/scm/adapters/abstract_adapter.rb:252:17: C: [Corrected] Performance/RedundantBlockCall: Use yield instead of block.call.
block.call(io) if block_given?
^^^^^^^^^^^^^^
Fix:
root@df2fd1389bf4:/work# git diff
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb
index 67a1f17a3..14f8f09c4 100644
--- a/lib/redmine/scm/adapters/abstract_adapter.rb
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb
@@ -249,7 +249,7 @@ module Redmine
IO.popen(cmd, mode) do |io|
io.set_encoding("ASCII-8BIT") if io.respond_to?(:set_encoding)
io.close_write unless options[:write_stdin]
- block.call(io) if block_given?
+ yield(io) if block_given?
end
rescue => e
msg = strip_credential(e.message)
Files
Actions