1
0
Fork 0
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:
Akira Matsuda 2019-09-17 19:37:11 +09:00
parent a221ee84da
commit 5c07e1a3f4

View file

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