Skip to content

Conversation

@enebo
Copy link
Member

@enebo enebo commented Dec 23, 2025

….to_hash

*nil no longer calls nil.to_a, similar to how **nil does not call nil.to_hash. [Feature #21047]

This could be optimized more but this matches semantics. The missing optimization is the parser(s) need to see literal nil and then set a new flag on build_splat marking that fact. Then the helper can use a cached empty frozen array. The bulk of the improvement is not dispatching so this will be a smaller percentage of improvement on a pretty uncommon case.

….to_hash

*nil no longer calls nil.to_a, similar to how **nil does not call nil.to_hash. [Feature #21047]

This could be optimized more but this matches semantics.  The missing optimization is the parser(s) need to see literal `nil` and then set a new
flag on build_splat marking that fact.  Then the helper can use a cached
empty frozen array.  The bulk of the improvement is not dispatching so this
will be a smaller percentage of improvement on a pretty uncommon case.
@enebo enebo added this to the JRuby 10.1.0.0 milestone Dec 23, 2025
@enebo
Copy link
Member Author

enebo commented Dec 23, 2025

Note: I updated Ruby version to 3.5.0 which is not the actual version. This was to match versioning currently used in ruby/spec to hit the specs updated for Ruby 4.0.0. I assume ruby/spec will update this soon and we can sync and change to proper version.

@headius
Copy link
Member

headius commented Dec 23, 2025

@enebo The version guards for 3.5 should still run if the version is 4.0. I think the specs have been updated but not synced yet.

@enebo
Copy link
Member Author

enebo commented Dec 23, 2025

@headius haha of course it should. I will update it to 4.0

@enebo enebo marked this pull request as draft December 23, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants