1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib
John Hawthorn 9a959a0c45 Avoid string allocations in BacktraceCleaner
Our backtraces tend to be fairly large so this operates over quite a few
strings.

Previously, each filter would call `String#sub`, which always returns a
new string object, and uses a new string buffer any time it modifies the
string.

String#slice allows Ruby to share the same internal string buffer, which
should be faster and use less memory. In cases where changes aren't
necessary we can also reuse the same string object.

This should not change behaviour except for the last filter which
changes from sub(/\.\//, "") to sub(/\A\.\//, ""), which I think was the
original intention.
2019-10-03 13:10:47 -07:00
..
minitest Railities typo fixes. 2019-02-01 16:42:40 +05:30
rails Avoid string allocations in BacktraceCleaner 2019-10-03 13:10:47 -07:00
rails.rb Fix document formatting of Rails.group [ci skip] 2019-09-05 19:00:20 +09:00