aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-21 16:33:06 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-21 16:33:06 -0700
commitb754d9b56d437933c1a0bcc333f8b55efd87af57 (patch)
treeb53f9232c90007171840a1dfa45a3962f2556211 /actionpack/lib/action_dispatch
parent6bd9ade0629811e4e8e0347b8f1bc2c84f811ce2 (diff)
downloadrails-b754d9b56d437933c1a0bcc333f8b55efd87af57.tar.gz
rails-b754d9b56d437933c1a0bcc333f8b55efd87af57.tar.bz2
rails-b754d9b56d437933c1a0bcc333f8b55efd87af57.zip
drop hash allocations during match
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/journey/router.rb4
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