diff options
| author | Ellen Marie Dash <me@duckie.co> | 2024-09-28 17:31:00 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-10-23 20:03:15 +0000 |
| commit | 0f5941a5ddef0d76217ab271b36b8da03d3ce6a4 (patch) | |
| tree | d8b54de16273c66c5059e85fecd482a829937191 /lib | |
| parent | 65fd8606a9577f9d0726f3b34d4aa8ebb27515f7 (diff) | |
[rubygems/rubygems] Replace .map{...}.compact with .filter_map {...}
https://github.com/rubygems/rubygems/commit/18c4ea7d00
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rubygems/spec_fetcher.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb index be612e9cc8..a64fc89a5d 100644 --- a/lib/rubygems/spec_fetcher.rb +++ b/lib/rubygems/spec_fetcher.rb @@ -181,7 +181,7 @@ class Gem::SpecFetcher min_length = gem_name.length - max max_length = gem_name.length + max - matches = names.map do |n| + matches = names.filter_map do |n| len = n.name.length # If the length is min_length or shorter, we've done `max` deletions. # If the length is max_length or longer, we've done `max` insertions. @@ -206,7 +206,7 @@ class Gem::SpecFetcher # If all else fails, return the name and the calculated distance. [n.name, distance] - end.compact + end matches = if matches.empty? && type != :prerelease suggest_gems_from_name gem_name, :prerelease |
