about summary refs log tree commit homepage
path: root/lib/rainbows/fiber
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-06-18 06:41:58 +0000
committerEric Wong <normalperson@yhbt.net>2010-06-18 07:44:55 +0000
commited9f3e90939cfa9efcc6e5e9382f1e1f40c49834 (patch)
tree32cda6265c16975daebe3c1f0c1430c622e2f608 /lib/rainbows/fiber
parent0e4014888f4f7f17d45c96677d672a538c6e6d94 (diff)
downloadrainbows-ed9f3e90939cfa9efcc6e5e9382f1e1f40c49834.tar.gz
Array#[] lookups are slightly faster under both rbx and 1.9,
and easier to read.
Diffstat (limited to 'lib/rainbows/fiber')
-rw-r--r--lib/rainbows/fiber/base.rb4
-rw-r--r--lib/rainbows/fiber/rev.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/rainbows/fiber/base.rb b/lib/rainbows/fiber/base.rb
index a056152..54f797b 100644
--- a/lib/rainbows/fiber/base.rb
+++ b/lib/rainbows/fiber/base.rb
@@ -49,7 +49,7 @@ module Rainbows
         ret[1].concat(RD.keys).each { |c| c.f.resume }
 
         # accept is an expensive syscall, filter out listeners we don't want
-        (ret.first & LISTENERS).each(&block)
+        (ret[0] & LISTENERS).each(&block)
       end
 
       # wakes up any sleepers that need to be woken and
@@ -91,7 +91,7 @@ module Rainbows
           env[REMOTE_ADDR] = remote_addr
           response = APP.call(env.update(RACK_DEFAULTS))
 
-          if 100 == response.first.to_i
+          if 100 == response[0].to_i
             client.write(EXPECT_100_RESPONSE)
             env.delete(HTTP_EXPECT)
             response = APP.call(env)
diff --git a/lib/rainbows/fiber/rev.rb b/lib/rainbows/fiber/rev.rb
index a733103..b8ec56b 100644
--- a/lib/rainbows/fiber/rev.rb
+++ b/lib/rainbows/fiber/rev.rb
@@ -91,7 +91,7 @@ module Rainbows::Fiber
           env[REMOTE_ADDR] = remote_addr
           response = APP.call(env.update(RACK_DEFAULTS))
 
-          if 100 == response.first.to_i
+          if 100 == response[0].to_i
             client.write(EXPECT_100_RESPONSE)
             env.delete(HTTP_EXPECT)
             response = APP.call(env)