[ruby/net-http] use +'' everywhere

https://github.com/ruby/net-http/commit/1077427152
This commit is contained in:
Josh Nichols 2023-08-14 11:17:45 -04:00 committed by git
parent 70da92cdf7
commit ea321a654d
2 changed files with 3 additions and 3 deletions

View File

@ -316,7 +316,7 @@ class Net::HTTPGenericRequest
boundary ||= SecureRandom.urlsafe_base64(40)
chunked_p = chunked?
buf = String.new
buf = +''
params.each do |key, value, h={}|
key = quote_string(key, charset)
filename =
@ -401,7 +401,7 @@ class Net::HTTPGenericRequest
if /[\r\n]/ =~ reqline
raise ArgumentError, "A Request-Line must not contain CR or LF"
end
buf = String.new
buf = +''
buf << reqline << "\r\n"
each_capitalized do |k,v|
buf << "#{k}: #{v}\r\n"

View File

@ -648,7 +648,7 @@ class Net::HTTPResponse
if block
Net::ReadAdapter.new(block)
else
dest || String.new
dest || +''
end
end