diff options
author | Gosha Arinich <me@goshakkk.name> | 2013-01-02 19:01:01 +0300 |
---|---|---|
committer | Gosha Arinich <me@goshakkk.name> | 2013-01-02 19:29:50 +0300 |
commit | 8ef780c3e2df86fa678982a5db80421ccf4d4dee (patch) | |
tree | a56c5be56a502bdc14c3cfa3d8ae10508a0602b5 | |
parent | bdaafae550051cddc8db88f464717840d2248111 (diff) | |
download | rails-8ef780c3e2df86fa678982a5db80421ccf4d4dee.tar.gz rails-8ef780c3e2df86fa678982a5db80421ccf4d4dee.tar.bz2 rails-8ef780c3e2df86fa678982a5db80421ccf4d4dee.zip |
remove another unnecessary dup
-rw-r--r-- | actionpack/lib/action_dispatch/journey/formatter.rb | 8 |
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) |