mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
[ruby/cgi] Use String#concat instead of String#+ for reducing cpu usage
9907b76dad
Co-authored-by: "Yusuke Endoh" <mame@ruby-lang.org>
This commit is contained in:
parent
aa31c893a2
commit
fc60a04de9
1 changed files with 3 additions and 2 deletions
|
@ -190,10 +190,11 @@ class CGI
|
|||
values ||= ""
|
||||
values = values.split('&').collect{|v| CGI.unescape(v,@@accept_charset) }
|
||||
if cookies.has_key?(name)
|
||||
values = cookies[name].value + values
|
||||
end
|
||||
cookies[name].concat(values)
|
||||
else
|
||||
cookies[name] = Cookie.new(name, *values)
|
||||
end
|
||||
end
|
||||
|
||||
cookies
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue