about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-11-21 08:52:30 +0000
committerEric Wong <e@80x24.org>2015-11-21 08:54:43 +0000
commite40421d475def4ee9e6eb4b6ec7b00da2b5f59d5 (patch)
tree03bc71152809d73a84fd7b0f53b1710e06174155
parent8fe5c0d649fa930c9027df42a2de9bb23f6ef8b8 (diff)
downloadrainbows-e40421d475def4ee9e6eb4b6ec7b00da2b5f59d5.tar.gz
Even with frozen string literals enabled in Ruby 2.3.0dev,
dstrings still create garbage as the optimizer is
not yet smart enough to optimize it despite the limited
choice of internals being known.

Maybe in the future Ruby will be smart enough, but not yet...
-rw-r--r--lib/rainbows/response.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb
index 0b5e542..3e48c65 100644
--- a/lib/rainbows/response.rb
+++ b/lib/rainbows/response.rb
@@ -46,8 +46,8 @@ module Rainbows::Response
         end
       end
     end
-    write(buf << "Connection: #{alive ? 'keep-alive'.freeze
-                                      : 'close'.freeze}\r\n\r\n")
+    write(buf << (alive ? "Connection: keep-alive\r\n\r\n".freeze
+                        : "Connection: close\r\n\r\n".freeze))
 
     if hijack
       body = nil # ensure caller does not close body