aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-02 13:58:32 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-02 13:58:32 -0800
commitef61504c6ea4c282cf85ab54797ff708ec6031c9 (patch)
treea8850b4a40b61e363b089a37d52a2a0365e1a05d /actionpack
parent44930b2def7fe9a6f3bc199bb3cd86c35ffbaba3 (diff)
parent8ef780c3e2df86fa678982a5db80421ccf4d4dee (diff)
downloadrails-ef61504c6ea4c282cf85ab54797ff708ec6031c9.tar.gz
rails-ef61504c6ea4c282cf85ab54797ff708ec6031c9.tar.bz2
rails-ef61504c6ea4c282cf85ab54797ff708ec6031c9.zip
Merge pull request #8697 from goshakkk/undup
Remove another unnecessary dup
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/formatter.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/journey/formatter.rb b/actionpack/lib/action_dispatch/journey/formatter.rb
index e8d3c35d37..cf755bfbeb 100644
--- a/actionpack/lib/action_dispatch/journey/formatter.rb
+++ b/actionpack/lib/action_dispatch/journey/formatter.rb
@@ -37,18 +37,16 @@ module ActionDispatch
private
def extract_parameterized_parts(route, options, recall, parameterize = nil)
- data = recall.merge(options)
+ parameterized_parts = recall.merge(options)
keys_to_keep = route.parts.reverse.drop_while { |part|
!options.key?(part) || (options[part] || recall[part]).nil?
} | route.required_parts
- (data.keys - keys_to_keep).each do |bad_key|
- data.delete(bad_key)
+ (parameterized_parts.keys - keys_to_keep).each do |bad_key|
+ parameterized_parts.delete(bad_key)
end
- parameterized_parts = data.dup
-
if parameterize
parameterized_parts.each do |k, v|
parameterized_parts[k] = parameterize.call(k, v)