diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-03-02 11:16:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-03-02 11:16:09 -0800 |
commit | b1051c5dfa0a5d9f7bb672ce9223167d1b5415a9 (patch) | |
tree | 1c74eb1ab7387f7c27333d815cdd1c6c6e60f362 /actionpack | |
parent | 37654d12ae95f751a91167a68bfb8d1bfd168d9c (diff) | |
download | rails-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.rb | 2 |
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 |