1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

drop hash allocations during match

This commit is contained in:
Aaron Patterson 2014-05-21 16:33:06 -07:00
parent 6bd9ade062
commit b754d9b56d

View file

@ -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