Browse files

drop hash allocations during match

  • Loading branch information...
1 parent 6bd9ade commit b754d9b56d437933c1a0bcc333f8b55efd87af57 @tenderlove tenderlove committed May 21, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_dispatch/journey/router.rb
View
4 actionpack/lib/action_dispatch/journey/router.rb
@@ -136,11 +136,11 @@ def find_routes env
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

0 comments on commit b754d9b

Please sign in to comment.