-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force recycle intermediate collection in Hash#transform_keys! #4329
Conversation
As |
Thank you for letting me know! 😂 |
Thank you! |
Please Do not use |
🙇
I should note it. Thanks for your alerting 🙏 I have created a PR to just revert this as #4341. Please merge it if it is needed. |
Thank you for your quick patch. It was not your fault, because it is not noted anywhere. |
…6ebe55d91187d9635e0183d47dbf38e95b1141,522d4cd32f7727886f4fcbc28ed29c08d361ee20: [Backport #17735] Keep non evaluated keys in `Hash#transform_keys!` [Bug #17735] --- hash.c | 6 +++++- spec/ruby/core/hash/transform_keys_spec.rb | 12 +++++++++++- test/ruby/test_hash.rb | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) Clear an intermediate hash [Bug #17735] --- hash.c | 1 + 1 file changed, 1 insertion(+) Hide an intermediate array --- hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Force recycle intermediate collection in Hash#transform_keys! [Bug #17735] * Force recycle intermediate hash * Force recycle intermediate array too #4329 (comment) --- hash.c | 2 ++ 1 file changed, 2 insertions(+)
This PR might be just a question 🙇
ruby/hash.c
Lines 4389 to 4411 in fb6ebe5
So this code needs to same way...? 🤔 (I'm not sure, how to check the changed behaviors in ruby code layer...)
ref: #4294, 5e5fb72
@nobu Could you review? 🙏