reduce function calls on Array

This commit is contained in:
Aaron Patterson
2010-09-29 15:43:27 -07:00
parent 3f88f26d1e
commit ab0d216b67

View File

@@ -441,9 +441,8 @@ module ActionController
#
# Returns String.
def encode_credentials(token, options = {})
values = ["token=#{token.to_s.inspect}"]
options.each do |key, value|
values << "#{key}=#{value.to_s.inspect}"
values = ["token=#{token.to_s.inspect}"] + options.map do |key, value|
"#{key}=#{value.to_s.inspect}"
end
"Token #{values * ", "}"
end