diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-04-28 12:57:39 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-04-28 12:57:39 -0300 |
commit | 72a2edd8c308cf63237b9e010f6595fd3ad08463 (patch) | |
tree | 2ec76e5491076d82760c72f59044a950fe9d74e9 /railties/lib/rails/application | |
parent | af024f4b1efecbcc01b22393178271a72dfb6cfb (diff) | |
download | rails-72a2edd8c308cf63237b9e010f6595fd3ad08463.tar.gz rails-72a2edd8c308cf63237b9e010f6595fd3ad08463.tar.bz2 rails-72a2edd8c308cf63237b9e010f6595fd3ad08463.zip |
Refactor RoutesReloader a bit to avoid creating extra hash objects
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/routes_reloader.rb | 5 |
1 files changed, 2 insertions, 3 deletions
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 |