diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-03-24 23:49:43 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-03-24 23:49:43 -0700 |
commit | 64ccb59c9aba9e9f7186e2332927a911763869bf (patch) | |
tree | b599a2c79c582c459633e5888ccfe4b29e6b471b /actionpack | |
parent | 3756a3fdfe8d339a53bf347487342f93fd9e1edb (diff) | |
parent | 6880489e257d937cd8ca5dd105485444fb48b7cc (diff) | |
download | rails-64ccb59c9aba9e9f7186e2332927a911763869bf.tar.gz rails-64ccb59c9aba9e9f7186e2332927a911763869bf.tar.bz2 rails-64ccb59c9aba9e9f7186e2332927a911763869bf.zip |
Merge pull request #5570 from avakhov/ac-caching-split
ActionController caching small String#split optimization
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/caching/actions.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index ba96735e56..ceac11bbfb 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -170,14 +170,14 @@ module ActionController #:nodoc: options.reverse_merge!(:format => @extension) if options.is_a?(Hash) end - path = controller.url_for(options).split(%r{://}).last + path = controller.url_for(options).split('://', 2).last @path = normalize!(path) end private def normalize!(path) path << 'index' if path[-1] == ?/ - path << ".#{extension}" if extension and !path.split('?').first.ends_with?(".#{extension}") + path << ".#{extension}" if extension and !path.split('?', 2).first.ends_with?(".#{extension}") URI.parser.unescape(path) end end |