about summary refs log tree commit homepage
diff options
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)
parent8fe5c0d649fa930c9027df42a2de9bb23f6ef8b8 (diff)
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...
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
-    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