From 70c976bdd85bb8515fea01d6ad6074ef472fc2e0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Nov 2015 02:47:24 +0000 Subject: reduce constant lookup dependencies Unicorn 5 removes some constants we were using, and constant lookups + inline caching are waste of time anyways on newer Rubies with the opt_str_freeze bytecode instruction. This may reduce performance for folks on older Rubies (probably not noticeable); but improves performance for folks on newer Rubies. --- lib/rainbows/coolio/client.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/rainbows/coolio/client.rb') diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb index 843f574..c05fd3a 100644 --- a/lib/rainbows/coolio/client.rb +++ b/lib/rainbows/coolio/client.rb @@ -122,9 +122,9 @@ class Rainbows::Coolio::Client < Coolio::IO def app_call input KATO.delete(self) disable if enabled? - @env[RACK_INPUT] = input - @env[REMOTE_ADDR] = @_io.kgio_addr - @env[ASYNC_CALLBACK] = method(:write_async_response) + @env['rack.input'] = input + @env['REMOTE_ADDR'] = @_io.kgio_addr + @env['async.callback'] = method(:write_async_response) @hp.hijack_setup(@env, @_io) status, headers, body = catch(:async) { APP.call(@env.merge!(RACK_DEFAULTS)) @@ -157,7 +157,7 @@ class Rainbows::Coolio::Client < Coolio::IO KATO[self] = Time.now end else - on_read(Z) + on_read(''.freeze) end end rescue => e -- cgit v1.2.3-24-ge0c7