diff options
author | Jeremy Evans <[email protected]> | 2025-04-20 01:09:13 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-04-22 11:27:24 +0900 |
commit | 51d0e5877283a260f994b05fde6411d39a49bc99 () | |
tree | 9447fdbb18feee646adf737444e0714e9c876808 /lib/rubygems | |
parent | 56c1a15eb70eaed2acf84cb449f19a9745dcfe44 (diff) |
[rubygems/rubygems] Avoid unnecessary splat allocation
Because get_push_scope is a method call, Ruby will allocate an array for *args even though it is not necessary to do so. Using a local variable avoids the allocation. Found by the performance warning in Ruby feature 21274. https://.com/rubygems/rubygems/commit/0473c0cf32
-rw-r--r-- | lib/rubygems/commands/push_command.rb | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -92,7 +92,8 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo private def send_push_request(name, args) - rubygems_api_request(*args, scope: get_push_scope) do |request| body = Gem.read_binary name if options[:attestations].any? request.set_form([ |