From b37d7a70f9a6d9a114fb21b525fbf1eb9bfcca38 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 15 Sep 2005 05:30:56 +0000 Subject: Speed up cookie use by decreasing string copying #2194 [skae] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2245 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../action_controller/cgi_ext/cookie_performance_fix.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb') diff --git a/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb b/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb index 1c30f82b19..d73cb0355f 100644 --- a/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb +++ b/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb @@ -71,28 +71,28 @@ class CGI #:nodoc: # Convert the Cookie to its string representation. def to_s buf = "" - buf += @name + '=' + buf << @name << '=' if @value.kind_of?(String) - buf += CGI::escape(@value) + buf << CGI::escape(@value) else - buf += @value.collect{|v| CGI::escape(v) }.join("&") + buf << @value.collect{|v| CGI::escape(v) }.join("&") end if @domain - buf += '; domain=' + @domain + buf << '; domain=' << @domain end if @path - buf += '; path=' + @path + buf << '; path=' << @path end if @expires - buf += '; expires=' + CGI::rfc1123_date(@expires) + buf << '; expires=' << CGI::rfc1123_date(@expires) end if @secure == true - buf += '; secure' + buf << '; secure' end buf -- cgit v1.2.3