Skip to content

Commit

Permalink
Merge pull request #805 from tgxworld/reduce_string_allocations
Browse files Browse the repository at this point in the history
Reduce string allocations.
  • Loading branch information
tenderlove committed Feb 19, 2015
2 parents 7b238fc + c1510b0 commit 331a32e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rack/utils.rb
Expand Up @@ -308,9 +308,9 @@ def set_cookie_header!(header, key, value)
value = value[:value]
end
value = [value] unless Array === value
cookie = escape(key) + "=" +
value.map { |v| escape v }.join("&") +
"#{domain}#{path}#{max_age}#{expires}#{secure}#{httponly}"

cookie = "#{escape(key)}=#{value.map { |v| escape v }.join('&')}#{domain}" \
"#{path}#{max_age}#{expires}#{secure}#{httponly}"

case header["Set-Cookie"]
when nil, ''
Expand Down

0 comments on commit 331a32e

Please sign in to comment.