diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-07 10:27:30 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-07 13:43:16 -0800 |
commit | 58dbf0952b94b01d4a434fa880755f9a320c6103 (patch) | |
tree | f9fa4be59dc9384c6abb60fab9732155e13c2c4d /lib/rainbows/ev_core.rb | |
parent | 2d2416daa554dd530b5f2cfeffe3e0e31505c824 (diff) | |
download | rainbows-58dbf0952b94b01d4a434fa880755f9a320c6103.tar.gz |
Hash#[] is slightly slower on the miss case due to calling Hash#default (but faster for the hit case, probably because it is inlined in 1.9).
Diffstat (limited to 'lib/rainbows/ev_core.rb')
-rw-r--r-- | lib/rainbows/ev_core.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb index a9fc41e..66d177f 100644 --- a/lib/rainbows/ev_core.rb +++ b/lib/rainbows/ev_core.rb @@ -50,7 +50,7 @@ module Rainbows::EvCore # returns whether to enable response chunking for autochunk models def stream_response_headers(status, headers, alive) headers = Rack::Utils::HeaderHash.new(headers) - if headers[Content_Length] + if headers.include?(Content_Length) rv = false else rv = !!(headers[Transfer_Encoding] =~ %r{\Achunked\z}i) |