Skip to content

Commit

Permalink
style: Suppress Style/MapIntoArray cop
Browse files Browse the repository at this point in the history
```
lib/god.rb:518:7: C: [Correctable] Style/MapIntoArray: Use map instead of each to map elements into an array.
      items.each { |w| jobs << Thread.new { w.signal(signal) } }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
  • Loading branch information
mishina2228 committed Apr 22, 2024
1 parent 7bfcf97 commit d2e9872
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/god.rb
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ def self.status
# Returns an Array of String names of the tasks affected.
def self.signal(name, signal)
items = watches_by_name(name)
jobs = []
items.each { |w| jobs << Thread.new { w.signal(signal) } }
jobs = items.map { |w| Thread.new { w.signal(signal) } }
jobs.each(&:join)
items.map(&:name)
end
Expand Down

0 comments on commit d2e9872

Please sign in to comment.