From b1051c5dfa0a5d9f7bb672ce9223167d1b5415a9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 2 Mar 2015 11:16:09 -0800 Subject: use arg size for parallel iteration we already know the length of the args, so we can use that length for parallel iteration and cut down on allocations for `url_for` calls. --- actionpack/lib/action_dispatch/routing/route_set.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 7eb61af770..652936929f 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -215,7 +215,7 @@ module ActionDispatch def parameterize_args(args) params = {} - @required_parts.zip(args.map(&:to_param)) { |k,v| params[k] = v } + @arg_size.times { |i| params[@required_parts[i]] = args[i].to_param } params end -- cgit v1.2.3