Vote #81110
完了Replace gsub with tr, delete, or squeeze
0%
説明
@String#tr@, @String#delete@, and @String#squeeze@ are faster than @String#gsub@.
https://docs.rubocop.org/rubocop-performance/cops_performance.html#performancestringreplacement
https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
https://docs.rubocop.org/rubocop-performance/cops_performance.html#performancesqueeze
https://github.com/JuanitoFatas/fast-ruby#remove-extra-spaces-or-other-contiguous-characters-code
Replacement can be done with RuboCop:
bundle exec rubocop --only Performance/StringReplacement,Performance/Squeeze -a
journals
--------------------------------------------------------------------------------
Committed.
--------------------------------------------------------------------------------