From: Ryan Davis Date: 2009-11-16T09:51:37+09:00 Subject: [ruby-core:26753] (send #2) cgi.rb cleanup (not sure why my previous email about this got dropped) Can I commit this? > Index: lib/cgi.rb > =================================================================== > --- lib/cgi.rb (revision 25789) > +++ lib/cgi.rb (working copy) > @@ -971,7 +971,7 @@ > end > > def read_multipart(boundary, content_length) > - params = Hash.new([]) > + params = Hash.new { |h,k| h[k] = [] } > boundary = "--" + boundary > quoted_boundary = Regexp.quote(boundary, "n") > buf = "" > @@ -1063,11 +1063,8 @@ > /Content-Disposition:.* name="?([^\";\s]*)"?/ni.match(head) > name = $1.dup > > - if params.has_key?(name) > - params[name].push(body) > - else > - params[name] = [body] > - end > + params[name].push(body) > + > break if buf.size == 0 > break if content_length == -1 > end