Skip to content

Commit

Permalink
simpler, dry implementation for HeaderHash#to_hash, fixes rack#177
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Jun 16, 2011
1 parent b82e4f0 commit d0e8aed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rack/utils.rb
Expand Up @@ -351,9 +351,9 @@ def each
end

def to_hash
Hash[*map do |k, v|
[k, v.respond_to?(:to_ary) ? v.to_ary.join("\n") : v]
end.flatten]
hash = {}
each { |k,v| hash[k] = v }
hash
end

def [](k)
Expand Down

0 comments on commit d0e8aed

Please sign in to comment.