Skip to content

Commit

Permalink
PERF: change inject({}) to Hash + map
Browse files Browse the repository at this point in the history
Signed-off-by: raggi <jftucker@gmail.com>
  • Loading branch information
spastorino authored and raggi committed Oct 3, 2010
1 parent a440ffb commit 351a969
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/rack/auth/digest/params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ module Digest
class Params < Hash

def self.parse(str)
split_header_value(str).inject(new) do |header, param|
Params[split_header_value(str).map do |param|
k, v = param.split('=', 2)
header[k] = dequote(v)
header
end
[k, dequote(v)]
end]
end

def self.dequote(str) # From WEBrick::HTTPUtils
Expand Down

0 comments on commit 351a969

Please sign in to comment.