about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-12-26 19:57:15 +0000
committerEric Wong <e@80x24.org>2018-12-27 05:59:41 +0000
commitbfffc6cdab85743b5617a06c094b0544086e3cbf (patch)
treebce453f9483fccde2f2a3d8c2ac86b37d14b33d3
parentcf10098ab354953eb4d3306dbc11175c306c9b96 (diff)
downloadyahns-bfffc6cdab85743b5617a06c094b0544086e3cbf.tar.gz
No point in increasing the complexity for cases it's not.
-rw-r--r--extras/exec_cgi.rb6
1 files 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