diff options
| author | Ellen Marie Dash <me@duckie.co> | 2024-10-23 14:25:09 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-10-23 20:03:15 +0000 |
| commit | 60d84354182c77cbd3d52fcd5387f434e12c2dfb (patch) | |
| tree | 4509dfa9dbfee289f45ed6aa78c553a805b9a3fe | |
| parent | ab7c800ea826a4a848a78a8b495baddca6f22440 (diff) | |
[rubygems/rubygems] [SpecFetcher] Avoid unneeded string allocation.
https://github.com/rubygems/rubygems/commit/1024505d8e
| -rw-r--r-- | lib/rubygems/spec_fetcher.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb index 99b62e4e53..3118496e75 100644 --- a/lib/rubygems/spec_fetcher.rb +++ b/lib/rubygems/spec_fetcher.rb @@ -193,7 +193,8 @@ class Gem::SpecFetcher next unless n.match_platform? # The candidate name, normalized the same as gem_name. - normalized_name = n.name.downcase.tr("_-", "") + normalized_name = n.name.downcase + normalized_name.tr!("_-", "") # If we found an exact match (after stripping underscores and hyphens), # that's our most likely candidate. |
