summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/combination_spec.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2024-07-12 13:28:53 -0700
committerJeremy Evans <code@jeremyevans.net>2024-07-18 22:17:21 -0700
commit94e7d2664388039fc8c2f6a063017cae22193fa3 (patch)
tree16eac64dc63bc08a75563fbc71ed1c0e1f1ec99f /spec/ruby/core/array/combination_spec.rb
parent2c79a7641ffbd5da7d5215a218e0d6866f061423 (diff)
Avoid array allocation for f(*empty_ary, **hash) when def f(x)
This avoids an array allocation when calling a method that does not accept a positional splat or keywords with both a positional splat and keywords. Previously, Ruby would dup the positional splat to append the keyword splat to it. Then it would flatten the dupped positional splat array to the VM stack. This flattens the given positional splat to the VM stack, then adds the keyword splat hash after the last positional splat element on the VM stack, avoiding the need to modify the positional splat array.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11161
Diffstat (limited to 'spec/ruby/core/array/combination_spec.rb')
0 files changed, 0 insertions, 0 deletions