Permalink
Browse files

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
  • Loading branch information...
1 parent c1505e3 commit b37d7a70f9a6d9a114fb21b525fbf1eb9bfcca38 @dhh dhh committed Sep 15, 2005
Showing with 9 additions and 7 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +7 −7 actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb
View
@@ -1,5 +1,7 @@
*SVN*
+* Speed up cookie use by decreasing string copying #2194 [skae]
+
* Fixed access to "Host" header with requests made by crappy old HTTP/1.0 clients #2124 [Marcel Molina]
* Added easy assignment of fragment cache store through use of symbols for included stores (old way still works too)
@@ -71,28 +71,28 @@ def secure=(val)
# 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

0 comments on commit b37d7a7

Please sign in to comment.