From eacb4264af7593a41487625d5a7a6f6986c58b47 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 12 May 2014 11:38:23 -0700 Subject: Hash#except is expensive and this is a hotspot, so use a dup + delete --- actionpack/lib/action_dispatch/routing/route_set.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 1ec6fa674b..440193cb42 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -657,7 +657,8 @@ module ActionDispatch script_name = original_script_name + script_name end - path_options = options.except(*RESERVED_OPTIONS) + path_options = options.dup + RESERVED_OPTIONS.each { |ro| path_options.delete ro } path_options = yield(path_options) if block_given? path, params = generate(path_options, recall || {}) -- cgit v1.2.3