summary refs log tree commit homepage
diff options
authorEric Wong <>2015-06-30 22:19:21 +0000
committerEric Wong <>2015-06-30 22:35:58 +0000
commitf84309ebb9c792d0a2ffec5ffc2f859b361cddc8 (patch)
parentfb2f10e1d7a72e6787720003342a21f11b879614 (diff)
This should save over 100 bytes of bytecode overhead due to
reduced method dispatch points.  The performance difference
when this is actually hit could go either way depending on
how String#<< and realloc(3) interact, but it's uncommon
enough that nobody is expected to notice either way.
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb
index ec8b7c8..c1aa738 100644
--- a/lib/unicorn/http_response.rb
+++ b/lib/unicorn/http_response.rb
@@ -39,7 +39,7 @@ module Unicorn::HttpResponse
           if value.include?("\n".freeze)
             # avoiding blank, key-only cookies with /\n+/
-            buf << value.split(/\n+/).map! { |v| "#{key}: #{v}\r\n" }.join
+            value.split(/\n+/).each { |v| buf << "#{key}: #{v}\r\n" }
             buf << "#{key}: #{value}\r\n"