From f279422e3346314ebec6b2156534c0fa5ebd5a98 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 28 Feb 2011 18:03:06 -0800 Subject: no need to pass a regex to Regexp.compile --- actionpack/lib/action_dispatch/middleware/static.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware/static.rb') diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 40c85d420a..c5598f3e56 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -5,10 +5,10 @@ module ActionDispatch attr_reader :ext def initialize(at, root) - @at, @root = at.chomp('/'), root.chomp('/') - @compiled_at = (Regexp.compile(/^#{Regexp.escape(at)}/) unless @at.blank?) - @compiled_root = Regexp.compile(/^#{Regexp.escape(root)}/) - @file_server = ::Rack::File.new(@root) + @at, @root = at.chomp('/'), root.chomp('/') + @compiled_at = /^#{Regexp.escape(at)}/ unless @at.blank? + @compiled_root = /^#{Regexp.escape(root)}/ + @file_server = ::Rack::File.new(@root) ext = ::ActionController::Base.page_cache_extension @ext = "{,#{ext},/index#{ext}}" -- cgit v1.2.3