summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfyoung <gfyoung17@gmail.com>2018-10-18 10:18:10 -0700
committergfyoung <gfyoung17@gmail.com>2018-10-18 10:53:55 -0700
commitbff618094425e38940ca92a79cc089682f8ad10d (patch)
treee1f7d0376a90510bb2a99a4c88327ba3c9acb3af
parent5c2c53df4a4d7e169c6a44ab3e2b17c822fa08d4 (diff)
downloadgitlab-ce-repo-forks/gitlab-ce-frozen-string-enable-lib-gitlab.tar.gz
Simplify http_io.rb frozen string enablerepo-forks/gitlab-ce-frozen-string-enable-lib-gitlab
Expect test failures, as we need to ensure that `outbuf` is passed in as a mutable string.
-rw-r--r--lib/gitlab/http_io.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/http_io.rb b/lib/gitlab/http_io.rb
index d47ee6e9b49..9d7763fc5ac 100644
--- a/lib/gitlab/http_io.rb
+++ b/lib/gitlab/http_io.rb
@@ -75,7 +75,7 @@ module Gitlab
end
end
- def read(length = nil, outbuf = "")
+ def read(length = nil, outbuf = nil)
out = []
length ||= size - tell
@@ -95,7 +95,10 @@ module Gitlab
out = out.join
# If outbuf is passed, we put the output into the buffer. This supports IO.copy_stream functionality
- outbuf = "#{outbuf[outbuf.bytesize,]}#{out}" if outbuf # rubocop:disable Lint/UselessAssignment
+ if outbuf
+ outbuf.replace(out)
+ end
+
out
end