mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
[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.
0473c0cf32
This commit is contained in:
parent
56c1a15eb7
commit
51d0e58772
1 changed files with 2 additions and 1 deletions
|
@ -92,7 +92,8 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
|
||||||
private
|
private
|
||||||
|
|
||||||
def send_push_request(name, args)
|
def send_push_request(name, args)
|
||||||
rubygems_api_request(*args, scope: get_push_scope) do |request|
|
scope = get_push_scope
|
||||||
|
rubygems_api_request(*args, scope: scope) do |request|
|
||||||
body = Gem.read_binary name
|
body = Gem.read_binary name
|
||||||
if options[:attestations].any?
|
if options[:attestations].any?
|
||||||
request.set_form([
|
request.set_form([
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue