mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Reduce Hash allocations
Merging multiple Hashes in Ruby < 2.6 is so hard...
This commit is contained in:
parent
a221ee84da
commit
5c07e1a3f4
1 changed files with 4 additions and 3 deletions
|
@ -40,11 +40,12 @@ module ActionDispatch
|
|||
req.path_info = "/" + req.path_info unless req.path_info.start_with? "/"
|
||||
end
|
||||
|
||||
parameters = route.defaults.merge parameters.each_value { |val|
|
||||
val.force_encoding(::Encoding::UTF_8)
|
||||
tmp_params = set_params.merge route.defaults
|
||||
parameters.each_pair { |key, val|
|
||||
tmp_params[key] = val.force_encoding(::Encoding::UTF_8)
|
||||
}
|
||||
|
||||
req.path_parameters = set_params.merge parameters
|
||||
req.path_parameters = tmp_params
|
||||
|
||||
status, headers, body = route.app.serve(req)
|
||||
|
||||
|
|
Loading…
Reference in a new issue