mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Stop using inject({}) to build hashes. It is harder to read and slower.
This commit is contained in:
parent
fdb4cd5b38
commit
589de27bcd
1 changed files with 2 additions and 4 deletions
|
@ -122,10 +122,8 @@ module Devise
|
|||
# Returns values from the request object.
|
||||
def request_values
|
||||
keys = request_keys.respond_to?(:keys) ? request_keys.keys : request_keys
|
||||
keys.inject({}) do |hash, key|
|
||||
hash[key] = self.request.send(key)
|
||||
hash
|
||||
end
|
||||
values = keys.map { |k| self.request.send(k) }
|
||||
Hash[keys.zip(values)]
|
||||
end
|
||||
|
||||
# Parse authentication keys considering if they should be enforced or not.
|
||||
|
|
Loading…
Reference in a new issue