diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-06-16 08:46:15 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-06-16 04:10:38 +0000 |
commit | 5bc1b56c14db279368c16a099c538189483c0a5a (patch) | |
tree | 36361b8aab74409dad293b6f4140fb01baa0895e | |
parent | 364a6d56d776270da09604816d623047c66c5e32 (diff) | |
download | ruby-5bc1b56c14db279368c16a099c538189483c0a5a.tar.gz |
[rubygems/rubygems] Auto-correct Performance/FlatMap
https://github.com/rubygems/rubygems/commit/b696edcd73
-rw-r--r-- | lib/bundler/fetcher/compact_index.rb | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 674d2b49f1..f9db920c32 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -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 diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index d8b7886af7..1bcfdf56ff 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -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) |