diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-21 16:33:06 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-21 16:33:06 -0700 |
commit | b754d9b56d437933c1a0bcc333f8b55efd87af57 (patch) | |
tree | b53f9232c90007171840a1dfa45a3962f2556211 | |
parent | 6bd9ade0629811e4e8e0347b8f1bc2c84f811ce2 (diff) | |
download | rails-b754d9b56d437933c1a0bcc333f8b55efd87af57.tar.gz rails-b754d9b56d437933c1a0bcc333f8b55efd87af57.tar.bz2 rails-b754d9b56d437933c1a0bcc333f8b55efd87af57.zip |
drop hash allocations during match
-rw-r--r-- | actionpack/lib/action_dispatch/journey/router.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index 01ce55f6f6..3bfa03713d 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -136,11 +136,11 @@ module ActionDispatch routes.map! { |r| match_data = r.path.match(req.path_info) - path_parameters = {} + path_parameters = r.defaults.dup match_data.names.zip(match_data.captures) { |name,val| path_parameters[name.to_sym] = Utils.unescape_uri(val) if val } - [match_data, r.defaults.merge(path_parameters), r] + [match_data, path_parameters, r] } end |