* lib/cgi.rb (CGI::Cookie::initialize): performance patch from

Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-03-14 08:08:51 +00:00
Родитель 657429b75b
Коммит 8ead071828
2 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -8,6 +8,11 @@ Fri Mar 14 16:59:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_LIB_PREFIX): fix for prefix.
Fri Mar 14 16:35:11 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/cgi.rb (CGI::Cookie::initialize): performance patch from
Makoto Kuwata <kwa@kuwata-lab.com> in [ruby-dev:34048].
Fri Mar 14 15:49:05 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_LIB_PREFIX): use libdir.

Просмотреть файл

@ -802,11 +802,16 @@ class CGI
#
# These keywords correspond to attributes of the cookie object.
def initialize(name = "", *value)
options = if name.kind_of?(String)
{ "name" => name, "value" => value }
else
name
end
if name.kind_of?(String)
@name = name
@value = value
%r|^(.*/)|.match(ENV["SCRIPT_NAME"])
@path = ($1 or "")
@secure = false
return super(@value)
end
options = name
unless options.has_key?("name")
raise ArgumentError, "`name' required"
end
@ -890,7 +895,7 @@ class CGI
if cookies.has_key?(name)
values = cookies[name].value + values
end
cookies[name] = Cookie::new({ "name" => name, "value" => values })
cookies[name] = Cookie::new(name, *values)
end
cookies