Project

General

Profile

Actions

Patch #34160

closed

Replace Hash#merge! with Hash#[]=

Added by Go MAEDA over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hash#[]= is faster than Hash#merge!.

https://docs.rubocop.org/rubocop-performance/cops_performance.html#performanceredundantmerge
https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code

Replacement can be done with RuboCop:

bundle exec rubocop --only Performance/RedundantMerge -a
Actions #1

Updated by Go MAEDA over 3 years ago

  • Status changed from New to Closed

Done.

Actions #2

Updated by Go MAEDA over 3 years ago

  • Assignee set to Go MAEDA
Actions

Also available in: Atom PDF