diff options
author | Timo Schilling <timo@schilling.io> | 2019-03-27 21:18:18 +0100 |
---|---|---|
committer | Timo Schilling <timo@schilling.io> | 2019-03-29 10:43:09 +0100 |
commit | 32db884967a8af0409bfcb2158ee948cd7ef619c (patch) | |
tree | b33344b26ee2a233d86d083f614ed4ce18d8ad80 /activesupport/lib | |
parent | e3f5f1c936869b81b01835adc9c683e058edfeaf (diff) | |
download | rails-32db884967a8af0409bfcb2158ee948cd7ef619c.tar.gz rails-32db884967a8af0409bfcb2158ee948cd7ef619c.tar.bz2 rails-32db884967a8af0409bfcb2158ee948cd7ef619c.zip |
Speed improvement for Hash#except
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/hash/except.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/except.rb b/activesupport/lib/active_support/core_ext/hash/except.rb index 6258610c98..5013812460 100644 --- a/activesupport/lib/active_support/core_ext/hash/except.rb +++ b/activesupport/lib/active_support/core_ext/hash/except.rb @@ -10,7 +10,7 @@ class Hash # This is useful for limiting a set of parameters to everything but a few known toggles: # @person.update(params[:person].except(:admin)) def except(*keys) - dup.except!(*keys) + slice(*self.keys - keys) end # Removes the given keys from hash and returns it. |