From 72a2edd8c308cf63237b9e010f6595fd3ad08463 Mon Sep 17 00:00:00 2001
From: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
Date: Sat, 28 Apr 2012 12:57:39 -0300
Subject: Refactor RoutesReloader a bit to avoid creating extra hash objects

---
 railties/lib/rails/application/routes_reloader.rb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'railties/lib/rails')

diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb
index 7f9190b01a..19f616ec50 100644
--- a/railties/lib/rails/application/routes_reloader.rb
+++ b/railties/lib/rails/application/routes_reloader.rb
@@ -24,12 +24,11 @@ module Rails
 
       def updater
         @updater ||= begin
-          dirs = @external_routes.inject({}) do |hash, dir|
-            hash.merge(dir.to_s => ["rb"])
+          dirs = @external_routes.each_with_object({}) do |dir, hash|
+            hash[dir.to_s] = %w(rb)
           end
 
           updater = ActiveSupport::FileUpdateChecker.new(paths, dirs) { reload! }
-
           updater.execute
           updater
         end
-- 
cgit v1.2.3