diff options
author | Ellen Marie Dash <[email protected]> | 2024-09-28 17:31:00 -0400 |
---|---|---|
committer | git <[email protected]> | 2024-10-23 20:03:15 +0000 |
commit | 0f5941a5ddef0d76217ab271b36b8da03d3ce6a4 () | |
tree | d8b54de16273c66c5059e85fecd482a829937191 /lib | |
parent | 65fd8606a9577f9d0726f3b34d4aa8ebb27515f7 (diff) |
[rubygems/rubygems] Replace .map{...}.compact with .filter_map {...}
https://.com/rubygems/rubygems/commit/18c4ea7d00
-rw-r--r-- | lib/rubygems/spec_fetcher.rb | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -181,7 +181,7 @@ class Gem::SpecFetcher min_length = gem_name.length - max max_length = gem_name.length + max - matches = names.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 matches = if matches.empty? && type != :prerelease suggest_gems_from_name gem_name, :prerelease |