aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-30 10:56:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-30 10:56:55 -0700
commitfd924371126a50789d31582b9efa074fd47a803e (patch)
treea897c7edf10c46e12c628548413d9072b8942c32 /actionview
parentca20037899e55ddf734b727454a3180bebf82212 (diff)
downloadrails-fd924371126a50789d31582b9efa074fd47a803e.tar.gz
rails-fd924371126a50789d31582b9efa074fd47a803e.tar.bz2
rails-fd924371126a50789d31582b9efa074fd47a803e.zip
split nil / Hash cases in url_for
this reduces the number of comparisons and method calls `url_for` requires. The nil case no longer calls `symbolize_keys`, we already know options is nil, so no more ||=, and since it is nil we already know that options[:host] will be nil too.
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/routing_url_for.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionview/lib/action_view/routing_url_for.rb b/actionview/lib/action_view/routing_url_for.rb
index 33be06cbf7..b9e4b590e7 100644
--- a/actionview/lib/action_view/routing_url_for.rb
+++ b/actionview/lib/action_view/routing_url_for.rb
@@ -77,10 +77,10 @@ module ActionView
case options
when String
options
- when nil, Hash
- options ||= {}
- options = { :only_path => options[:host].nil? }.merge!(options.symbolize_keys)
- super
+ when nil
+ super({:only_path => true})
+ when Hash
+ super({ :only_path => options[:host].nil? }.merge!(options.symbolize_keys))
when :back
_back_url
when Array