diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-09-04 09:05:45 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-09-04 09:05:45 -0700 |
commit | e865d125431424562b5e252ed151f6bae8dd5e8f (patch) | |
tree | 93c181f5831e772f6ab044516fb36be43dbd3aa3 /actionpack/lib/action_dispatch/routing | |
parent | abb09054043c556ae38d2c9d1e9037eceb6dc426 (diff) | |
parent | 9b08afd2f4d501fb1710ba0ed4e19313093605c8 (diff) | |
download | rails-e865d125431424562b5e252ed151f6bae8dd5e8f.tar.gz rails-e865d125431424562b5e252ed151f6bae8dd5e8f.tar.bz2 rails-e865d125431424562b5e252ed151f6bae8dd5e8f.zip |
Merge pull request #2852 from milandobrota/remove_unneeded_explicit_nil_checks
if ... nil? is more expensive than unless
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 0c43954d81..21dc5af486 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1436,7 +1436,7 @@ module ActionDispatch name_prefix = @scope[:as] if parent_resource - return nil if as.nil? && action.nil? + return nil unless as || action collection_name = parent_resource.collection_name member_name = parent_resource.member_name |