diff options
-rw-r--r-- | lib/rack/utils.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb index 963824ab..5287ddc9 100644 --- a/lib/rack/utils.rb +++ b/lib/rack/utils.rb @@ -189,10 +189,8 @@ module Rack # the Cookie header such that those with more specific Path attributes # precede those with less specific. Ordering with respect to other # attributes (e.g., Domain) is unspecified. - Hash[].tap do |hash| - cookies = parse_query(env[HTTP_COOKIE], ';,') { |s| unescape(s) rescue s } - cookies.each { |k,v| hash[k] = Array === v ? v.first : v } - end + cookies = parse_query(env[HTTP_COOKIE], ';,') { |s| unescape(s) rescue s } + cookies.each_with_object({}) { |(k,v), hash| hash[k] = Array === v ? v.first : v } end module_function :parse_cookies |