aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-03-02 11:16:09 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2015-03-02 11:16:09 -0800
commitb1051c5dfa0a5d9f7bb672ce9223167d1b5415a9 (patch)
tree1c74eb1ab7387f7c27333d815cdd1c6c6e60f362 /actionpack
parent37654d12ae95f751a91167a68bfb8d1bfd168d9c (diff)
downloadrails-b1051c5dfa0a5d9f7bb672ce9223167d1b5415a9.tar.gz
rails-b1051c5dfa0a5d9f7bb672ce9223167d1b5415a9.tar.bz2
rails-b1051c5dfa0a5d9f7bb672ce9223167d1b5415a9.zip
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.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb2
1 files changed, 1 insertions, 1 deletions
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