From cd315e5a20b17d29679fb22b4e2ab44cd6d0edeb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 20 Nov 2010 07:45:57 +0800 Subject: stream_input: use String#sub! instead of gsub! There's no difference because of the \A anchor, but sub! is doesn't loop so it's simpler. --- lib/unicorn/stream_input.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unicorn/stream_input.rb b/lib/unicorn/stream_input.rb index 45d1336..619067d 100644 --- a/lib/unicorn/stream_input.rb +++ b/lib/unicorn/stream_input.rb @@ -80,7 +80,7 @@ class Unicorn::StreamInput re = /\A(.*?#{Regexp.escape(sep)})/ begin - @rbuf.gsub!(re, '') and return $1 + @rbuf.sub!(re, '') and return $1 return @rbuf.empty? ? nil : @rbuf.slice!(0, @rbuf.size) if eof? @socket.kgio_read(@@io_chunk_size, @buf) or eof! filter_body(once = '', @buf) -- cgit v1.2.3-24-ge0c7