From ed9f3e90939cfa9efcc6e5e9382f1e1f40c49834 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 18 Jun 2010 06:41:58 +0000 Subject: prefer Array#[] lookup to Array#first/Array#last Array#[] lookups are slightly faster under both rbx and 1.9, and easier to read. --- lib/rainbows/http_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/http_server.rb') diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index 3a30915..43604af 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -68,7 +68,7 @@ module Rainbows def worker_connections(*args) return @worker_connections if args.empty? - nr = args.first + nr = args[0] (Integer === nr && nr > 0) or raise ArgumentError, "worker_connections must be a positive Integer" @worker_connections = nr -- cgit v1.2.3-24-ge0c7