aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-12 17:33:00 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-12 17:59:44 -0700
commit325c9d5e5235db4b5210d9db6c863835d1ac7eed (patch)
tree0fcc5b335bba47a12f6ecd7f8eb36b8855833f6f /actionpack/lib/action_dispatch/routing/route_set.rb
parent890a189bb4a7476a226a9a1d609297eb52262a0a (diff)
downloadrails-325c9d5e5235db4b5210d9db6c863835d1ac7eed.tar.gz
rails-325c9d5e5235db4b5210d9db6c863835d1ac7eed.tar.bz2
rails-325c9d5e5235db4b5210d9db6c863835d1ac7eed.zip
avoid array allocation when extracting usernames and passwords
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index d61b430f68..52cca3e667 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -654,7 +654,13 @@ module ActionDispatch
def url_for(options)
options = default_url_options.merge(options || {})
- user, password = extract_authentication(options)
+ user = password = nil
+
+ if options[:user] && options[:password]
+ user = options.delete :user
+ password = options.delete :password
+ end
+
recall = options.delete(:_recall)
original_script_name = options.delete(:original_script_name).presence