From bfffc6cdab85743b5617a06c094b0544086e3cbf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 26 Dec 2018 19:57:15 +0000 Subject: extras/exec_cgi: @body_tip is always set No point in increasing the complexity for cases it's not. --- extras/exec_cgi.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extras/exec_cgi.rb b/extras/exec_cgi.rb index f143ac7..babda3c 100644 --- a/extras/exec_cgi.rb +++ b/extras/exec_cgi.rb @@ -31,10 +31,8 @@ class ExecCgi end def each - buf = @body_tip || ''.dup - if buf.size > 0 - yield buf - end + buf = @body_tip + yield buf unless buf.empty? case tmp = @rd.read_nonblock(8192, buf, exception: false) when :wait_readable -- cgit v1.2.3-24-ge0c7