Explorar o código

Apply Rubocop Performance/RedundantBlockCall (#23440)

Nick Schonning hai 1 ano
pai
achega
cec005068f
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      app/models/trends/history.rb
  2. 1 1
      app/workers/import/relationship_worker.rb

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

@@ -88,7 +88,7 @@ class Trends::History
 
   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

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

@@ -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) }
         .run
     else
-      block.call
+      yield
     end
   end
 end