From 45650156159ad2e71ac5cf04c8b780455ca90deb Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 10 Apr 2024 08:46:43 -0400 Subject: [PATCH] Fix `Style/MapIntoArray` cop in cli progress helper (#29884) --- lib/mastodon/cli/progress_helper.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/mastodon/cli/progress_helper.rb b/lib/mastodon/cli/progress_helper.rb index 4fcc47a7f7..f22492afcf 100644 --- a/lib/mastodon/cli/progress_helper.rb +++ b/lib/mastodon/cli/progress_helper.rb @@ -35,10 +35,8 @@ module Mastodon::CLI aggregate = Concurrent::AtomicFixnum.new(0) scope.reorder(nil).find_in_batches do |items| - futures = [] - - items.each do |item| - futures << Concurrent::Future.execute(executor: pool) do + futures = items.map do |item| + Concurrent::Future.execute(executor: pool) do if !progress.total.nil? && progress.progress + 1 > progress.total # The number of items has changed between start and now, # since there is no good way to predict the final count from