Skip to content
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

Fasterer speedup for hash_update_vs_hash_brackets #82

Open
manjunath724 opened this issue Jun 3, 2020 · 1 comment
Open

Fasterer speedup for hash_update_vs_hash_brackets #82

manjunath724 opened this issue Jun 3, 2020 · 1 comment
Labels

Comments

@manjunath724
Copy link

manjunath724 commented Jun 3, 2020

Hash.update is an alias for Hash.merge!

Currently we have hash_merge_bang_vs_hash_brackets which suggests us to replace Hash#merge!() with Hash#[] but it doesn't suggest for Hash#update().

Example

  • hash.merge!({"key" => "value"}) -> offensive
  • hash.update({"key" => value}) -> not offensive

Can we extend this to Hash.update()?

@DamirSvrtan
Copy link
Owner

Sounds good to me - would you be willing to document this speed up first in the https://github.com/JuanitoFatas/fast-ruby repository and then submit a PR to fasterer?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants