[rubygems/rubygems] Auto-correct Performance/FlatMap

https://github.com/rubygems/rubygems/commit/b696edcd73
This commit is contained in:
Hiroshi SHIBATA 2023-06-16 08:46:15 +09:00 committed by git
parent 364a6d56d7
commit 5bc1b56c14
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ module Bundler
@bundle_worker = nil # reset it. Not sure if necessary
serial_compact_index_client.dependencies(remaining_gems)
end
next_gems = deps.map {|d| d[3].map(&:first).flatten(1) }.flatten(1).uniq
next_gems = deps.flat_map {|d| d[3].flat_map(&:first) }.uniq
deps.each {|dep| gem_info << dep }
complete_gems.concat(deps.map(&:first)).uniq!
remaining_gems = next_gems - complete_gems

View File

@ -91,9 +91,9 @@ module Bundler
def spec_matches_for_glob(spec, glob)
return spec.matches_for_glob(glob) if spec.respond_to?(:matches_for_glob)
spec.load_paths.map do |lp|
spec.load_paths.flat_map do |lp|
Dir["#{lp}/#{glob}#{suffix_pattern}"]
end.flatten(1)
end
end
def stub_set_spec(stub, spec)