1
0
Fork 0
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:
Rafael França 2020-11-02 12:52:24 -05:00 committed by GitHub
commit 0300aa802a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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