From f875331e3282228d2019392b1653fb8ea39fd711 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <aaron.patterson@gmail.com>
Date: Wed, 16 Jul 2014 17:27:03 -0700
Subject: only extract :params from the options hash once

---
 actionpack/lib/action_dispatch/http/url.rb | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'actionpack')

diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index 6ba2820d09..f5e71f5a3d 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -48,9 +48,8 @@ module ActionDispatch
                    end
 
           if options.key? :params
-            params = options[:params].is_a?(Hash) ?
-                                 options[:params] :
-                                 { params: options[:params] }
+            param  = options[:params]
+            params = param.is_a?(Hash) ? param : { params: param }
 
             params.reject! { |_,v| v.to_param.nil? }
             result << "?#{params.to_query}" unless params.empty?
-- 
cgit v1.2.3