Browse Source

Apply Rubocop Performance/RedundantBlockCall (#23440)

closed-social-glitch-2
Nick Schonning 1 year ago
committed by GitHub
parent
commit
cec005068f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/models/trends/history.rb
  2. +1
    -1
      app/workers/import/relationship_worker.rb

+ 1
- 1
app/models/trends/history.rb View File

@ -88,7 +88,7 @@ class Trends::History
def each(&block) def each(&block)
if block_given? if block_given?
(0...7).map { |i| block.call(get(i.days.ago)) }
(0...7).map { |i| yield(get(i.days.ago)) }
else else
to_enum(:each) to_enum(:each)
end end

+ 1
- 1
app/workers/import/relationship_worker.rb View File

@ -49,7 +49,7 @@ class Import::RelationshipWorker
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) || error.is_a?(OpenSSL::SSL::SSLError) ? handle.call(error) : raise(error) } .with_error_handler { |error, handle| error.is_a?(HTTP::Error) || error.is_a?(OpenSSL::SSL::SSLError) ? handle.call(error) : raise(error) }
.run .run
else else
block.call
yield
end end
end end
end end

Loading…
Cancel
Save