mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #40504 from tbrisker/paramobjects
Reduce object allocations in param wrapping
This commit is contained in:
commit
0300aa802a
1 changed files with 4 additions and 2 deletions
|
@ -268,9 +268,11 @@ module ActionController
|
|||
def _extract_parameters(parameters)
|
||||
if include_only = _wrapper_options.include
|
||||
parameters.slice(*include_only)
|
||||
elsif _wrapper_options.exclude
|
||||
exclude = _wrapper_options.exclude + EXCLUDE_PARAMETERS
|
||||
parameters.except(*exclude)
|
||||
else
|
||||
exclude = _wrapper_options.exclude || []
|
||||
parameters.except(*(exclude + EXCLUDE_PARAMETERS))
|
||||
parameters.except(*EXCLUDE_PARAMETERS)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue