DamirSvrtan/fasterer

Fasterer speedup for hash_update_vs_hash_brackets

manjunath724 opened this issue · 1 comments

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()?

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!