Skip to content

Commit 351e726

Browse files
committed
Reduce Hash allocations
1 parent cac0e04 commit 351e726

File tree

1 file changed

+5
-3
lines changed
  • actionpack/lib/action_dispatch/request

1 file changed

+5
-3
lines changed

actionpack/lib/action_dispatch/request/utils.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ def self.normalize_encode_params(params)
5555
if params.has_key?(:tempfile)
5656
ActionDispatch::Http::UploadedFile.new(params)
5757
else
58-
params.transform_values do |val|
59-
normalize_encode_params(val)
60-
end.with_indifferent_access
58+
hwia = ActiveSupport::HashWithIndifferentAccess.new
59+
params.each_pair do |key, val|
60+
hwia[key] = normalize_encode_params(val)
61+
end
62+
hwia
6163
end
6264
else
6365
params

0 commit comments

Comments
 (0)