Skip to content
Browse files

Merge pull request #8697 from goshakkk/undup

Remove another unnecessary dup
  • Loading branch information...
2 parents 44930b2 + 8ef780c commit ef61504c6ea4c282cf85ab54797ff708ec6031c9 @rafaelfranca rafaelfranca committed Jan 2, 2013
Showing with 3 additions and 5 deletions.
  1. +3 −5 actionpack/lib/action_dispatch/journey/formatter.rb
View
8 actionpack/lib/action_dispatch/journey/formatter.rb
@@ -37,18 +37,16 @@ def clear
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)

0 comments on commit ef61504

Please sign in to comment.
Something went wrong with that request. Please try again.