From 325c9d5e5235db4b5210d9db6c863835d1ac7eed Mon Sep 17 00:00:00 2001
From: Aaron Patterson <aaron.patterson@gmail.com>
Date: Mon, 12 May 2014 17:33:00 -0700
Subject: avoid array allocation when extracting usernames and passwords

---
 actionpack/lib/action_dispatch/routing/route_set.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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
-- 
cgit v1.2.3