diff options
author | schneems <richard.schneeman@gmail.com> | 2015-07-25 00:25:47 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2015-07-30 12:30:47 -0500 |
commit | bff61ba27cb113b90f210a30173a8e66602615ca (patch) | |
tree | 691c5a1d5b64913514d5bab90cd1655b96aa6778 /actionpack/lib/action_dispatch/routing | |
parent | e76a84350595ca6772d3c00f456b35e411fba6c1 (diff) | |
download | rails-bff61ba27cb113b90f210a30173a8e66602615ca.tar.gz rails-bff61ba27cb113b90f210a30173a8e66602615ca.tar.bz2 rails-bff61ba27cb113b90f210a30173a8e66602615ca.zip |
Avoid calling to_s on nil in journey/formatter
When `defaults[key]` in `generate` in the journey formatter is called, it often returns a `nil` when we call `to_s` on a nil, it allocates an empty string. We can skip this check when the default value is nil.
This change buys us 35,431 bytes of memory and 887 fewer objects per request.
Thanks to @matthewd for help with the readability
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
0 files changed, 0 insertions, 0 deletions