Skip to content

Commit

Permalink
Apply Rubocop Performance/RedundantBlockCall (mastodon#23440)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni authored Feb 7, 2023
1 parent f31d9a5 commit cec0050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/trends/history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def aggregate(date_range)

def each(&block)
if block_given?
(0...7).map { |i| block.call(get(i.days.ago)) }
(0...7).map { |i| yield(get(i.days.ago)) }
else
to_enum(:each)
end
Expand Down
2 changes: 1 addition & 1 deletion app/workers/import/relationship_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def stoplight_wrap_request(domain, &block)
.with_error_handler { |error, handle| error.is_a?(HTTP::Error) || error.is_a?(OpenSSL::SSL::SSLError) ? handle.call(error) : raise(error) }
.run
else
block.call
yield
end
end
end

0 comments on commit cec0050

Please sign in to comment.