diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-11 14:40:45 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-06-11 14:40:45 -0700 |
commit | ed376985967e3c1391b57cf1f715b6a982e8c039 (patch) | |
tree | 75b360518dffaca941a5ded564556d9d4d013787 /actionpack/lib/action_dispatch/http | |
parent | 3aabac5b0d6ebf3647b6150803219d6acb5c33a6 (diff) | |
download | rails-ed376985967e3c1391b57cf1f715b6a982e8c039.tar.gz rails-ed376985967e3c1391b57cf1f715b6a982e8c039.tar.bz2 rails-ed376985967e3c1391b57cf1f715b6a982e8c039.zip |
remove useless nil check
irb(main):004:0> /foo/ !~ nil
=> true
irb(main):005:0> /foo/ !~ 'bar'
=> true
irb(main):006:0> /foo/ !~ 'foo'
=> false
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 0215de5d55..e970d20c39 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -99,7 +99,7 @@ module ActionDispatch end def named_host?(host) - host && IP_HOST_REGEXP !~ host + IP_HOST_REGEXP !~ host end def normalize_protocol(protocol) @@ -116,7 +116,7 @@ module ActionDispatch end def normalize_host(_host, options) - return _host if !named_host?(_host) + return _host unless named_host?(_host) tld_length = options[:tld_length] || @@tld_length |