Skip to content

Commit 1077427

Browse files
use +'' everywhere
1 parent 5194fd5 commit 1077427

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/net/http/generic_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def encode_multipart_form_data(out, params, opt)
316316
boundary ||= SecureRandom.urlsafe_base64(40)
317317
chunked_p = chunked?
318318

319-
buf = String.new
319+
buf = +''
320320
params.each do |key, value, h={}|
321321
key = quote_string(key, charset)
322322
filename =
@@ -401,7 +401,7 @@ def write_header(sock, ver, path)
401401
if /[\r\n]/ =~ reqline
402402
raise ArgumentError, "A Request-Line must not contain CR or LF"
403403
end
404-
buf = String.new
404+
buf = +''
405405
buf << reqline << "\r\n"
406406
each_capitalized do |k,v|
407407
buf << "#{k}: #{v}\r\n"

lib/net/http/response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def procdest(dest, block)
648648
if block
649649
Net::ReadAdapter.new(block)
650650
else
651-
dest || String.new
651+
dest || +''
652652
end
653653
end
654654

0 commit comments

Comments
 (0)