Skip to content

Commit

Permalink
use map instead of each_with_obj/concat
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Aug 7, 2020
1 parent 18a3731 commit 3d8cb82
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/awesome_spawn/command_line_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def sanitize(params)
end

def sanitize_associative_array(assoc_array)
assoc_array.each.with_object([]) do |item, array|
array.concat(sanitize_item(item))
end
assoc_array.flat_map { |item| sanitize_item(item) }
end

def sanitize_item(item)
Expand Down

0 comments on commit 3d8cb82

Please sign in to comment.