Skip to content

Commit

Permalink
[rubygems/rubygems] Auto-correct Performance/FlatMap
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and matzbot committed Jun 16, 2023
1 parent 364a6d5 commit 5bc1b56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/fetcher/compact_index.rb
Expand Up @@ -44,7 +44,7 @@ def specs_for_names(gem_names)
@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
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/rubygems_integration.rb
Expand Up @@ -91,9 +91,9 @@ def spec_missing_extensions?(spec, default = true)
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)
Expand Down

0 comments on commit 5bc1b56

Please sign in to comment.