diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 02:59:42 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 18:31:57 +0300 |
commit | 215228b477e9dae8cf3ba36af767ae12d4328e28 (patch) | |
tree | c293caf0c9e614837b5b195e55af67db690900e2 /lib | |
parent | 8924594a3e84f03c363031d0831960ad5ab822dd (diff) |
Enable Performance/RedundantBlockCall
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/optimistic_locking.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/shell.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/optimistic_locking.rb b/lib/gitlab/optimistic_locking.rb index 879d46446b3..76634ea0abf 100644 --- a/lib/gitlab/optimistic_locking.rb +++ b/lib/gitlab/optimistic_locking.rb @@ -6,7 +6,7 @@ module Gitlab loop do begin ActiveRecord::Base.transaction do - return block.call(subject) + return yield(subject) end rescue ActiveRecord::StaleObjectError retries -= 1 diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index 3faa336f142..330dfd866cb 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -145,7 +145,7 @@ module Gitlab # batch_add_keys { |adder| adder.add_key("key-42", "sha-rsa ...") } def batch_add_keys(&block) IO.popen(%W(#{gitlab_shell_path}/bin/gitlab-keys batch-add-keys), 'w') do |io| - block.call(KeyAdder.new(io)) + yield(KeyAdder.new(io)) end end |