From ed376985967e3c1391b57cf1f715b6a982e8c039 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 11 Jun 2014 14:40:45 -0700 Subject: 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 --- actionpack/lib/action_dispatch/http/url.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack') 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 -- cgit v1.2.3