summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-22 04:28:16 +0000
committerEric Wong <e@80x24.org>2015-08-22 04:28:16 +0000
commit535a627cbc0f10b549bc536c52323bc00af5944f (patch)
treed554a1039ad06ed084fb655f757d55b8ff23527a
parent4e7cab9f1727eccd90780d1ceb14948e0ace36a6 (diff)
We no longer need Ruby 1.8 compatibility, so use String#clear
to reduce argument passing and code size.
-rw-r--r--lib/unicorn/stream_input.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/unicorn/stream_input.rb b/lib/unicorn/stream_input.rb
index 9278f47..de5aeea 100644
--- a/lib/unicorn/stream_input.rb
+++ b/lib/unicorn/stream_input.rb
@@ -53,7 +53,7 @@ class Unicorn::StreamInput
           rv << @rbuf
           to_read -= @rbuf.size
         end
-        @rbuf.replace('')
+        @rbuf.clear
       end
       rv = nil if rv.empty? && length != 0
     else
@@ -130,8 +130,8 @@ private
       filter_body(@rbuf, @buf)
       dst << @rbuf
     end
-    ensure
-      @rbuf.replace('')
+  ensure
+    @rbuf.clear
   end
 
   def eof!